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); } }
ns.setURI("http://example.com"); ws = new WorkspaceInfoImpl(); ws.setId("wsid"); ws.setName("ws1");
public WorkspaceInfo createWorkspace() { return new WorkspaceInfoImpl(); }
@Test public void testPropertyEqualsSimple() { assertTrue(equal("prefix", ns.getPrefix()).evaluate(ns)); assertTrue(equal("id", ws.getId()).evaluate(ws)); assertFalse(equal("id", "somethingElse").evaluate(ws)); Set<StyleInfo> styles = new HashSet<StyleInfo>(); styles.add(style1); assertFalse(equal("styles", styles, MatchAction.ALL).evaluate(vectorLayer)); assertTrue(equal("styles", styles, MatchAction.ANY).evaluate(vectorLayer)); styles.add(style2); assertTrue(equal("styles", styles).evaluate(vectorLayer)); }
@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; }
final LayerInfo layer = new LayerInfoImpl(); LocalPublished.set(layer); final WorkspaceInfo ws = new WorkspaceInfoImpl(); LocalWorkspace.set(ws); final Object myState = new Object();
/** * 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); } }
@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 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); }
@Test public void testRequest() throws InterruptedException, ExecutionException { // setup the state final WorkspaceInfo ws = new WorkspaceInfoImpl(); LocalWorkspace.set(ws); // test it's transferred properly using the base class machinery testThreadLocalTransfer( new ThreadLocalTransferCallable(new LocalWorkspaceThreadLocalTransfer()) { @Override void assertThreadLocalCleaned() { assertNull(LocalWorkspace.get()); } @Override void assertThreadLocalApplied() { assertSame(ws, LocalWorkspace.get()); } }); } }
@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(); }
Catalog catalog = getCatalog(); WorkspaceInfoImpl workspace = new WorkspaceInfoImpl(); workspace.setName("NON_ADVERTISED"); NamespaceInfoImpl nameSpace = new NamespaceInfoImpl(); nameSpace.setPrefix("NON_ADVERTISED");
private CatalogInfo prototype(CatalogInfo original, Catalog catalog) { CatalogInfo prototype; if (original instanceof WorkspaceInfo) { prototype = new WorkspaceInfoImpl(); } else if (original instanceof DataStoreInfo) { prototype = new DataStoreInfoImpl(catalog); } else if (original instanceof CoverageStoreInfo) { prototype = new CoverageStoreInfoImpl(catalog); } else if (original instanceof WMSStoreInfo) { prototype = new WMSStoreInfoImpl((CatalogImpl) SecureCatalogImpl.unwrap(catalog)); } else if (original instanceof FeatureTypeInfo) { prototype = new FeatureTypeInfoImpl(catalog); } else if (original instanceof CoverageInfo) { prototype = new CoverageInfoImpl(catalog); } else if (original instanceof WMSLayerInfo) { prototype = new WMSLayerInfoImpl((CatalogImpl) SecureCatalogImpl.unwrap(catalog)); } else { throw new IllegalArgumentException(original.toString()); } return prototype; } }
ns.setURI("http//www.geoserver.org"); WorkspaceInfoImpl workspace = new WorkspaceInfoImpl(); workspace.setId("fakeWs"); workspace.setName("fakeWs");
Catalog catalog = getCatalog(); WorkspaceInfoImpl workspaceA = new WorkspaceInfoImpl(); workspaceA.setName("LG_TEST_WORKSPACE_A"); NamespaceInfoImpl nameSpaceA = new NamespaceInfoImpl(); nameSpaceA.setPrefix("LG_TEST_WORKSPACE_A"); nameSpaceA.setURI("http://lg-test-workspace-a.org"); WorkspaceInfoImpl workspaceB = new WorkspaceInfoImpl(); workspaceB.setName("LG_TEST_WORKSPACE_B"); NamespaceInfoImpl nameSpaceB = new NamespaceInfoImpl(); nameSpaceB.setPrefix("LG_TEST_WORKSPACE_B");
@Before public void setUp() throws Exception { // make a nice little catalog that does always tell us stuff is there Catalog catalog = createNiceMock(Catalog.class); expect(catalog.getWorkspaceByName((String) anyObject())) .andReturn(new WorkspaceInfoImpl()) .anyTimes(); expect(catalog.getLayerByName((String) anyObject())) .andReturn(new LayerInfoImpl()) .anyTimes(); replay(catalog); // prepare some base rules props = new Properties(); props.put("mode", "CHALLENGE"); props.put("topp.states.w", "ROLE_TSW"); props.put("topp.*.w", "ROLE_TW"); props.put("*.*.r", "*"); props.put("group.r", "ROLE_GROUP"); dao = new MemoryDataAccessRuleDAO(catalog, props); }
ns.setURI("http://fakews.org"); WorkspaceInfoImpl workspace = new WorkspaceInfoImpl(); workspace.setId("fakeWs"); workspace.setName("fakeWs");
WorkspaceInfoImpl ws = new WorkspaceInfoImpl(); ws.setName(generic.getResource().getStore().getWorkspace().getName());
@Override protected void onSetUp(SystemTestData testData) throws Exception { super.onSetUp(testData); NamespaceInfo gsmlNamespace = new NamespaceInfoImpl(); gsmlNamespace.setPrefix("gsml"); gsmlNamespace.setURI("http://www.cgi-iugs.org/xml/GeoSciML/2"); WorkspaceInfo gsmlWorkspace = new WorkspaceInfoImpl(); gsmlWorkspace.setName("gsml"); getCatalog().add(gsmlNamespace); getCatalog().add(gsmlWorkspace); }