String[] scaleNames = { "uno", "dos", "tres" };
int tileWidth = 128;
int tileHeight = 512;
boolean yCoordinateFirst = true;
GridSet gridSet = GridSetFactory.createGridSet(name, srs, extent, alignTopLeft,
resolutions, scaleDenoms, metersPerUnit, pixelSize, scaleNames, tileWidth,
tileHeight, yCoordinateFirst);
gridSet.setDescription("test description");
config.addOrReplaceGridSet(new XMLGridSet(gridSet));
config.save();
try {
XMLConfiguration.validate(XMLConfiguration
.loadDocument(new FileInputStream(configFile)));
} catch (SAXParseException e) {
log.error(e.getMessage());
fail(e.getMessage());
}
XMLConfiguration config2 = new XMLConfiguration(null, configDir.getAbsolutePath());
GridSetBroker gridSetBroker2 = new GridSetBroker(true, false);
config2.initialize(gridSetBroker2);
GridSet gridSet2 = gridSetBroker2.get(name);
assertNotNull(gridSet2);
assertEquals(gridSet, gridSet2);
}