@Test
public void testGridCS() throws Exception {
Map<String, Object> raw = baseMap();
final String layerId = getLayerId(TASMANIA_BM);
raw.put("identifier", layerId);
raw.put("format", "image/tiff");
raw.put("BoundingBox", "-45,146,-42,147");
raw.put("GridCS", GridCS.GCSGrid2dSquare.getXmlConstant());
GetCoverageType getCoverage =
(GetCoverageType) reader.read(reader.createRequest(), parseKvp(raw), raw);
assertEquals(
GridCS.GCSGrid2dSquare.getXmlConstant(),
getCoverage.getOutput().getGridCRS().getGridCS());
raw.put("GridCS", GridCS.GCSGrid2dSquare.getXmlConstant().toUpperCase());
getCoverage = (GetCoverageType) reader.read(reader.createRequest(), parseKvp(raw), raw);
assertEquals(
GridCS.GCSGrid2dSquare.getXmlConstant(),
getCoverage.getOutput().getGridCRS().getGridCS());
raw.put("GridCS", "Hoolabaloola");
try {
reader.read(reader.createRequest(), parseKvp(raw), raw);
fail("We should have had a WcsException here?");
} catch (WcsException e) {
assertEquals(InvalidParameterValue.name(), e.getCode());
assertEquals("GridCS", e.getLocator());
}
}