@Override public Set<String> getNames() { return broker.getNames(); }
@Override public Set<String> getCanonicalNames() { return broker.getNames(); }
@Test public void testGridSetList() { Set<String> names = gridSetBroker.getNames(); int i = 0; for (GridSet grid : gridSetBroker.getGridSets()) { assertTrue(names.contains(grid.getName())); i++; } assertEquals(i, names.size()); }
@Test public void testRemoveGridsetOld() throws IOException { String gridsetToRemove = GWCConfigIntegrationTestData.GRIDSET_EPSG2163; // remove the only layer referencing the gridset first gridSetBroker.remove(gridsetToRemove); assertFalse(gridSetBroker.getNames().contains(gridsetToRemove)); assertNull(gridSetBroker.get(gridsetToRemove)); }
@Test public void testRemoveGridset() throws IOException { String gridsetToRemove = GWCConfigIntegrationTestData.GRIDSET_EPSG2163; // remove the only layer referencing the gridset first tileLayerDispatcher.removeLayer(GWCConfigIntegrationTestData.LAYER_TOPP_STATES); tileLayerDispatcher.removeGridSet(gridsetToRemove); assertFalse(gridSetBroker.getNames().contains(gridsetToRemove)); assertNull(gridSetBroker.get(gridsetToRemove)); }
@Test public void testAddGridset() throws GeoWebCacheException, IOException { String gridsetName = "EPSG:3005"; GridSet epsg3005 = GridSetFactory.createGridSet( gridsetName, SRS.getSRS(gridsetName), new BoundingBox(35043.6538, 440006.8768, 1885895.3117, 1735643.8497), false, null, new double[] {25000000, 1250000, 500000, 250000}, null, GridSetFactory.DEFAULT_PIXEL_SIZE_METER, null, 256, 256, false); tileLayerDispatcher.addGridSet(epsg3005); assertTrue(gridSetBroker.getNames().contains(gridsetName)); assertEquals(gridSetBroker.get(gridsetName), epsg3005); }
@Test public void testAddGridset() throws GeoWebCacheException, IOException { String gridsetName = "EPSG:3005"; GridSet epsg3005 = GridSetFactory.createGridSet( gridsetName, SRS.getSRS(gridsetName), new BoundingBox(35043.6538, 440006.8768, 1885895.3117, 1735643.8497), false, null, new double[] {25000000, 1250000, 500000, 250000}, null, GridSetFactory.DEFAULT_PIXEL_SIZE_METER, null, 256, 256, false); gridSetBroker.addGridSet(epsg3005); assertTrue(gridSetBroker.getNames().contains(gridsetName)); assertEquals(gridSetBroker.get(gridsetName), epsg3005); }