private static void addWorkspaceNamespace(String wsName) { WorkspaceInfoImpl ws = new WorkspaceInfoImpl(); ws.setName(wsName); catalog.add(ws); NamespaceInfo ns = new NamespaceInfoImpl(); ns.setPrefix(wsName); ns.setURI("http://www.geoserver.org/" + wsName); catalog.add(ns); }
@Test public void testAddIsolatedWorkspace() { // create isolated workspace WorkspaceInfoImpl workspace = new WorkspaceInfoImpl(); workspace.setName("isolated_workspace"); workspace.setIsolated(true); try { // add it to the catalog catalog.add(workspace); // retrieve the isolated workspace WorkspaceInfo foundWorkspace = catalog.getWorkspaceByName("isolated_workspace"); assertThat(foundWorkspace.isIsolated(), is(true)); } finally { // remove the isolated workspace catalog.remove(workspace); } }
/** * Helper method that creates a workspace and add it to the catalog. This method will first * create the namespace and then the workspace. The create workspaces prefixes are stored in * {@link #CREATED_WORKSPACES_PREFIXES}. */ protected void createWorkspace(String prefix, String namespaceUri, boolean isolated) { Catalog catalog = getCatalog(); // create the namespace NamespaceInfoImpl namespace = new NamespaceInfoImpl(); namespace.setPrefix(prefix); namespace.setURI(namespaceUri); namespace.setIsolated(isolated); catalog.add(namespace); // create the workspace WorkspaceInfoImpl workspace = new WorkspaceInfoImpl(); workspace.setName(prefix); workspace.setIsolated(isolated); catalog.add(workspace); // store created workspace CREATED_WORKSPACES_PREFIXES.add(prefix); } }
ws.setName("ws1");
@Before public void setup() { // create a test workspace WorkspaceInfoImpl workspace = new WorkspaceInfoImpl(); workspace.setId("jms-test-workspace"); workspace.setName("jms-test-workspace"); getCatalog().add(workspace); testWorkspace = workspace; }
@Before public void setup() { // create a test workspace WorkspaceInfoImpl workspace = new WorkspaceInfoImpl(); workspace.setId("jms-test-workspace"); workspace.setName("jms-test-workspace"); getCatalog().add(workspace); }
@Override protected void onSetUp(SystemTestData testData) throws Exception { // create the test workspace if it doesn't exsist workspace = new WorkspaceInfoImpl(); workspace.setId("test-workspace"); workspace.setName("test-workspace"); getCatalog().add(workspace); // initiate the handlers related with services serviceHandler = GeoServerExtensions.bean(JMSServiceHandlerSPI.class).createHandler(); }
@Override protected void onSetUp(SystemTestData testData) throws Exception { // create a test workspace WorkspaceInfoImpl workspace = new WorkspaceInfoImpl(); workspace.setName(WORKSPACE_NAME); getCatalog().add(workspace); // create test workspace namespace NamespaceInfoImpl nameSpace = new NamespaceInfoImpl(); nameSpace.setPrefix(WORKSPACE_NAME); nameSpace.setURI(WORKSPACE_URI); getCatalog().add(nameSpace); }
workspace.setName("NON_ADVERTISED"); NamespaceInfoImpl nameSpace = new NamespaceInfoImpl(); nameSpace.setPrefix("NON_ADVERTISED");
workspace.setName("fakeWs");
ws.setName(generic.getResource().getStore().getWorkspace().getName());
ws.setName(generic.getResource().getStore().getWorkspace().getName());
workspaceInfo.setName("testWs"); catalog.add(workspaceInfo); catalog.setDefaultWorkspace(workspaceInfo);
workspace.setName("fakeWs");