public void testModifyGridsetTruncates() throws Exception { final String oldName = "EPSG:4326"; final String newName = "MyEPSG:4326"; final GridSet oldGridset = gridSetBroker.get(oldName); final GridSet newGridset; { XMLGridSet xmlGridSet = new XMLGridSet(oldGridset); xmlGridSet.setName(newName); // make it so the gridset forces truncation xmlGridSet.setAlignTopLeft(!xmlGridSet.getAlignTopLeft()); newGridset = xmlGridSet.makeGridSet(); } XMLConfiguration xmlConfig = mock(XMLConfiguration.class); mediator = spy(mediator); when(mediator.getXmlConfiguration()).thenReturn(xmlConfig); when(tld.getConfiguration(same(tileLayer))).thenReturn(config); when(tld.getConfiguration(same(tileLayerGroup))).thenReturn(config); mediator.modifyGridSet(oldName, newGridset); verify(storageBroker, times(1)).deleteByGridSetId(eq(tileLayer.getName()), eq(oldName)); verify(storageBroker, times(1)) .deleteByGridSetId(eq(tileLayerGroup.getName()), eq(oldName)); }
xmlGridSet.setName("My4326"); xmlGridSet.setAlignTopLeft(!xmlGridSet.getAlignTopLeft()); newGridset = xmlGridSet.makeGridSet(); gridSetBroker.put(newGridset);
if (getAlignTopLeft() == null) { setAlignTopLeft(false); SRS srs = getSrs(); BoundingBox extent = getExtent(); Boolean alignTopLeft = getAlignTopLeft(); double[] resolutions = getResolutions(); double[] scaleDenominators = getScaleDenominators();
/** Copy constructor */ public XMLGridSet(XMLGridSet orig) { setAlignTopLeft(orig.getAlignTopLeft()); setExtent(orig.getExtent() == null ? null : new BoundingBox(orig.getExtent())); setResolutions(orig.getResolutions() == null ? null : orig.getResolutions().clone()); setLevels(orig.getLevels()); setScaleDenominators( orig.getScaleDenominators() == null ? null : orig.getScaleDenominators().clone()); setMetersPerUnit(orig.getMetersPerUnit()); setName(orig.getName()); setDescription(orig.getDescription()); setPixelSize(orig.getPixelSize()); setScaleNames(orig.getScaleNames() == null ? null : orig.getScaleNames().clone()); setSrs(orig.getSrs()); setTileWidth(orig.getTileWidth()); setTileHeight(orig.getTileHeight()); }