/** * Returns a config suitable to match the old defaults when the integrated GWC behaivour was not * configurable. */ public static GWCConfig getOldDefaults() { GWCConfig config = new GWCConfig(); config.setOldDefaults(); return config; }
/** * Returns a config suitable to match the old defaults when the integrated GWC behaivour was not * configurable. */ public static GWCConfig getOldDefaults() { GWCConfig config = new GWCConfig(); config.setOldDefaults(); return config; }
private synchronized void loadConfig() throws IOException { File configFile = findConfigFile(); checkNotNull(configFile, "gwc config file does not exist: ", GWC_CONFIG_FILE); XStreamPersister xmlPersister = this.persisterFactory.createXMLPersister(); configureXstream(xmlPersister.getXStream()); try { InputStream in = new FileInputStream(configFile); try { this.config = xmlPersister.load(in, GWCConfig.class); } finally { in.close(); } LOGGER.fine("GWC GeoServer specific configuration loaded from " + GWC_CONFIG_FILE); } catch (Exception e) { LOGGER.log( Level.WARNING, "Error loading GWC GeoServer specific " + "configuration from " + configFile.getAbsolutePath() + ". Applying defaults.", e); this.config = new GWCConfig(); } }
protected void setUp() throws Exception { oldDefaults = GWCConfig.getOldDefaults(); config = new GWCConfig(); }
private synchronized void loadConfig() throws IOException { Resource configFile = findConfigFile(); checkNotNull(configFile, "gwc config file does not exist: ", GWC_CONFIG_FILE); XStreamPersister xmlPersister = this.persisterFactory.createXMLPersister(); configureXstream(xmlPersister.getXStream()); try { try (InputStream in = configFile.in()) { this.config = xmlPersister.load(in, GWCConfig.class); } LOGGER.fine("GWC GeoServer specific configuration loaded from " + GWC_CONFIG_FILE); } catch (Exception e) { LOGGER.log( Level.WARNING, "Error loading GWC GeoServer specific " + "configuration from " + configFile.path() + ". Applying defaults.", e); this.config = new GWCConfig(); } }
persister = new GWCConfigPersister(new XStreamPersisterFactory(), resourceLoader); GWCConfig expected = new GWCConfig(); GWCConfig actual = persister.getConfig(); assertEquals(expected, actual);
public void testAutoConfigureLayers() throws Exception { GWCConfig insaneDefaults = new GWCConfig(); insaneDefaults.setMetaTilingX(-1); assertFalse(insaneDefaults.isSane());
GWCConfig gwcConfig = new GWCConfig(); gwcConfig.setInnerCachingEnabled(true); gwcConfig.setEnabledPersistence(false);