Refine search
@Test public void testRemoveWMSStore() throws Exception { testAddWMSStore(); File f = new File(testData.getDataDirectoryRoot(), "workspaces/acme/demowms"); assertTrue(f.exists()); WMSStoreInfo wms = catalog.getStoreByName("acme", "demowms", WMSStoreInfo.class); catalog.remove(wms); assertFalse(f.exists()); }
@Test public void testRemoveWMSLayer() throws Exception { testAddWMSLayer(); File d = new File(testData.getDataDirectoryRoot(), "workspaces/acme/demowms/foo"); assertTrue(d.exists()); WMSLayerInfo wli = catalog.getResourceByName("bar", "foo", WMSLayerInfo.class); catalog.remove(wli); assertFalse(d.exists()); }
@Test public void testRemoveAllGrups() throws Exception { catalog.remove(container); catalog.remove(nature); assertThat(containerNamesForGroup(nature), empty()); assertThat(containerNamesForResource(MockData.LAKES), empty()); assertThat(containerNamesForResource(MockData.FORESTS), empty()); assertThat(containerNamesForResource(MockData.ROAD_SEGMENTS), empty()); }
@Test public void testRemoveFeatureType() throws Exception { testAddFeatureType(); File d = new File(testData.getDataDirectoryRoot(), "workspaces/acme/foostore/foo"); assertTrue(d.exists()); FeatureTypeInfo ft = catalog.getFeatureTypeByName("bar", "foo"); catalog.remove(ft); assertFalse(d.exists()); }
@Test public void testRemoveCoverageStore() throws Exception { testAddCoverageStore(); File f = new File(testData.getDataDirectoryRoot(), "workspaces/acme/foostore"); assertTrue(f.exists()); CoverageStoreInfo cs = catalog.getCoverageStoreByName("acme", "foostore"); catalog.remove(cs); assertFalse(f.exists()); }
@Test public void testRemoveWMTSStore() throws Exception { testAddWMTSStore(); File f = new File(testData.getDataDirectoryRoot(), "workspaces/acme/demowmts"); assertTrue(f.exists()); WMTSStoreInfo wmts = catalog.getStoreByName("acme", "demowmts", WMTSStoreInfo.class); catalog.remove(wmts); assertFalse(f.exists()); }
@Test public void testRemoveLayerGroup() throws Exception { testAddLayerGroup(); File dataDirectoryRoot = testData.getDataDirectoryRoot(); File f = new File(dataDirectoryRoot, "layergroups/lg.xml"); assertTrue(f.exists()); LayerGroupInfo lg = catalog.getLayerGroupByName("lg"); catalog.remove(lg); assertFalse("removed lg", f.exists()); }
@Test public void testRemoveWMTSLayer() throws Exception { testAddWMTSLayer(); File d = new File(testData.getDataDirectoryRoot(), "workspaces/acme/demowmts/foo_wmts"); assertTrue(d.exists()); WMTSLayerInfo wli = catalog.getResourceByName("bar", "foo_wmts", WMTSLayerInfo.class); catalog.remove(wli); assertFalse(d.exists()); }
@Test public void testRemoveLayerGroupInLayerGroup() throws Exception { addLayerGroup(); LayerGroupInfo lg2 = catalog.getFactory().createLayerGroup(); lg2.setName("layerGroup2"); lg2.getLayers().add(lg); lg2.getStyles().add(s); catalog.add(lg2); try { catalog.remove(lg); fail("should have failed because lg is in another lg"); } catch (IllegalArgumentException expected) { } // removing the containing layer first should work catalog.remove(lg2); catalog.remove(lg); }