@Override public GWCConfig clone() { GWCConfig clone; try { clone = (GWCConfig) super.clone(); } catch (CloneNotSupportedException e) { throw new RuntimeException(e); } clone.setDefaultCachingGridSetIds(getDefaultCachingGridSetIds()); clone.setDefaultCoverageCacheFormats(getDefaultCoverageCacheFormats()); clone.setDefaultVectorCacheFormats(getDefaultVectorCacheFormats()); clone.setDefaultOtherCacheFormats(getDefaultOtherCacheFormats()); return clone; }
@Override public GWCConfig clone() { GWCConfig clone; try { clone = (GWCConfig) super.clone(); } catch (CloneNotSupportedException e) { throw new RuntimeException(e); } clone.setDefaultCachingGridSetIds(getDefaultCachingGridSetIds()); clone.setDefaultCoverageCacheFormats(getDefaultCoverageCacheFormats()); clone.setDefaultVectorCacheFormats(getDefaultVectorCacheFormats()); clone.setDefaultOtherCacheFormats(getDefaultOtherCacheFormats()); clone.setCacheConfigurations(getCacheConfigurations()); return clone; }
@Override public void setUp() { defaults = GWCConfig.getOldDefaults(); defaultVectorInfo = TileLayerInfoUtil.create(defaults); defaultVectorInfo.getMimeFormats().clear(); defaultVectorInfo.getMimeFormats().addAll(defaults.getDefaultVectorCacheFormats()); }
@Override protected void setUp() throws Exception { defaults = GWCConfig.getOldDefaults(); defaultVectorInfo = TileLayerInfoUtil.create(defaults); defaultVectorInfo.getMimeFormats().clear(); defaultVectorInfo.getMimeFormats().addAll(defaults.getDefaultVectorCacheFormats()); }
public static GeoServerTileLayerInfoImpl loadOrCreate(final LayerInfo layerInfo, final GWCConfig defaults) { GeoServerTileLayerInfoImpl info = LegacyTileLayerInfoLoader.load(layerInfo); if (info == null) { info = create(defaults); final ResourceInfo resource = layerInfo.getResource(); if (resource instanceof FeatureTypeInfo) { info.getMimeFormats().clear(); info.getMimeFormats().addAll(defaults.getDefaultVectorCacheFormats()); } else if (resource instanceof CoverageInfo) { info.getMimeFormats().clear(); info.getMimeFormats().addAll(defaults.getDefaultCoverageCacheFormats()); } checkAutomaticStyles(layerInfo, info); } info.setName(tileLayerName(layerInfo)); info.setId(layerInfo.getId()); return info; }
@Override protected void setUp() throws Exception { info = new GeoServerTileLayerInfoImpl(); defaults = GWCConfig.getOldDefaults(); defaultVectorInfo = TileLayerInfoUtil.create(defaults); defaultVectorInfo.getMimeFormats().clear(); defaultVectorInfo.getMimeFormats().addAll(defaults.getDefaultVectorCacheFormats()); }
/** * Creates a cached tile layer from the given Layer * * @param layerInfo the layer to cache * @param defaults default configuration */ public static GeoServerTileLayerInfoImpl loadOrCreate( final LayerInfo layerInfo, final GWCConfig defaults) { GeoServerTileLayerInfoImpl info = LegacyTileLayerInfoLoader.load(layerInfo); if (info == null) { info = create(defaults); final ResourceInfo resource = layerInfo.getResource(); if (resource instanceof FeatureTypeInfo) { info.getMimeFormats().clear(); info.getMimeFormats().addAll(defaults.getDefaultVectorCacheFormats()); } else if (resource instanceof CoverageInfo) { info.getMimeFormats().clear(); info.getMimeFormats().addAll(defaults.getDefaultCoverageCacheFormats()); } checkAutomaticStyles(layerInfo, info); } info.setName(tileLayerName(layerInfo)); info.setId(layerInfo.getId()); return info; }
public void testClone() { GWCConfig clone = config.clone(); assertEquals(config, clone); assertNotSame(config.getDefaultCachingGridSetIds(), clone.getDefaultCachingGridSetIds()); assertNotSame(config.getDefaultCoverageCacheFormats(), clone.getDefaultCoverageCacheFormats()); assertNotSame(config.getDefaultOtherCacheFormats(), clone.getDefaultOtherCacheFormats()); assertNotSame(config.getDefaultVectorCacheFormats(), clone.getDefaultVectorCacheFormats()); }
@Override protected void setUp() throws Exception { defaults = GWCConfig.getOldDefaults(); defaults.getDefaultVectorCacheFormats().clear(); defaults.getDefaultVectorCacheFormats().add("image/png8"); defaults.getDefaultOtherCacheFormats().clear(); defaults.getDefaultOtherCacheFormats().add("image/jpeg");
public void testSaneConfig() { assertTrue(config.isSane()); assertSame(config, config.saneConfig()); assertTrue(oldDefaults.isSane()); assertSame(oldDefaults, oldDefaults.saneConfig()); config.setMetaTilingX(-1); assertFalse(config.isSane()); assertTrue((config = config.saneConfig()).isSane()); config.setMetaTilingY(-1); assertFalse(config.isSane()); assertTrue((config = config.saneConfig()).isSane()); config.setGutter(-1); assertFalse(config.isSane()); assertTrue((config = config.saneConfig()).isSane()); config.getDefaultCachingGridSetIds().clear(); assertFalse(config.isSane()); assertTrue((config = config.saneConfig()).isSane()); config.getDefaultCoverageCacheFormats().clear(); assertFalse(config.isSane()); assertTrue((config = config.saneConfig()).isSane()); config.getDefaultOtherCacheFormats().clear(); assertFalse(config.isSane()); assertTrue((config = config.saneConfig()).isSane()); config.getDefaultVectorCacheFormats().clear(); assertFalse(config.isSane()); assertTrue((config = config.saneConfig()).isSane()); }