/** @see TileLayerConfiguration#getTileLayerNames() */ @Deprecated public Set<String> getTileLayerNames() { return getLayerNames(); }
@Test public void testSaveCurrentVersion() throws Exception { URL source = XMLConfiguration.class.getResource( XMLConfigurationBackwardsCompatibilityTest.GWC_125_CONFIG_FILE); configFile = new File(configDir, "geowebcache.xml"); FileUtils.copyURLToFile(source, configFile); gridSetBroker = new GridSetBroker(true, true); config = new XMLConfiguration(null, configDir.getAbsolutePath()); config.setGridSetBroker(gridSetBroker); config.afterPropertiesSet(); config.getLayerCount(); final String previousVersion = config.getVersion(); assertNotNull(previousVersion); // Do a modify without any changes to trigger a save; config.modifyLayer(config.getLayer(config.getLayerNames().iterator().next()).get()); final String currVersion = XMLConfiguration.getCurrentSchemaVersion(); assertNotNull(currVersion); assertFalse(previousVersion.equals(currVersion)); config = new XMLConfiguration(null, configDir.getAbsolutePath()); config.setGridSetBroker(gridSetBroker); config.afterPropertiesSet(); config.getLayerCount(); final String savedVersion = config.getVersion(); assertEquals(currVersion, savedVersion); }
@Test public void testRemoveLayer() { try { config.removeLayer("nonExistent"); fail("Expected exception removing nonExistant layer"); } catch (Exception e) { } Set<String> tileLayerNames = config.getLayerNames(); for (String name : tileLayerNames) { int count = config.getLayerCount(); config.removeLayer(name); assertEquals(count - 1, config.getLayerCount()); } }
@Test public void testSave() throws Exception { for (String name : config.getLayerNames()) { int count = config.getLayerCount(); config.removeLayer(name);