assertEquals(properties.get("SERVICE"), "WMS");
}
public void testCreateParser() throws Exception {
try{
WMSCapabilities capabilities = createCapabilities("1.3.0Capabilities.xml");
assertNotNull(capabilities);
assertEquals(capabilities.getVersion(), "1.3.0");
assertEquals(capabilities.getService().getName(), "WMS");
assertEquals(capabilities.getService().getTitle(), "World Map");
assertEquals(capabilities.getService().get_abstract(), "None");
assertEquals(capabilities.getService().getOnlineResource(), new URL("http://www2.demis.nl"));
assertEquals(capabilities.getService().getLayerLimit(), 40);
assertEquals(capabilities.getService().getMaxWidth(), 2000);
assertEquals(capabilities.getService().getMaxHeight(), 2000);
assertEquals(capabilities.getRequest().getGetCapabilities().getFormats().get(0), "text/xml");
assertEquals(capabilities.getRequest().getGetCapabilities().getGet(), new URL("http://www2.demis.nl/wms/wms.asp?wms=WorldMap&"));
assertEquals(capabilities.getRequest().getGetCapabilities().getPost(), new URL("http://www2.demis.nl/wms/wms.asp?wms=WorldMap&"));
assertEquals(capabilities.getRequest().getGetMap().getFormats().size(), 5);
assertEquals(capabilities.getRequest().getGetMap().getFormats().get(0), "image/gif");
assertEquals(capabilities.getRequest().getGetMap().getFormats().get(1), "image/png");
assertEquals(capabilities.getRequest().getGetMap().getFormats().get(2), "image/jpeg");
assertEquals(capabilities.getRequest().getGetMap().getFormats().get(3), "image/bmp");
assertEquals(capabilities.getRequest().getGetMap().getFormats().get(4), "image/swf");
assertEquals(capabilities.getRequest().getGetMap().getGet(), new URL("http://www2.demis.nl/wms/wms.asp?wms=WorldMap&"));
assertEquals(capabilities.getRequest().getGetFeatureInfo().getFormats().size(), 4);
assertEquals(capabilities.getRequest().getGetFeatureInfo().getFormats().get(0), "text/xml");
assertEquals(capabilities.getRequest().getGetFeatureInfo().getFormats().get(1), "text/plain");
assertEquals(capabilities.getRequest().getGetFeatureInfo().getFormats().get(2), "text/html");
assertEquals(capabilities.getRequest().getGetFeatureInfo().getFormats().get(3), "text/swf");
assertEquals(capabilities.getRequest().getGetFeatureInfo().getGet(), new URL("http://www2.demis.nl/wms/wms.asp?wms=WorldMap&"));
Layer topLayer = (Layer) capabilities.getLayerList().get(0);
assertNotNull(topLayer);
assertNull(topLayer.getParent());
assertFalse(topLayer.isQueryable());
assertEquals(topLayer.getTitle(), "World Map");
assertEquals(topLayer.getSrs().size(), 1);
assertTrue(topLayer.getSrs().contains("CRS:84"));
CRSEnvelope llbbox = topLayer.getLatLonBoundingBox();
assertNotNull(llbbox);
assertEquals(llbbox.getMinX(), -180, 0.0);
assertEquals(llbbox.getMaxX(), 180, 0.0);
assertEquals(llbbox.getMinY(), -90, 0.0);
assertEquals(llbbox.getMaxY(), 90, 0.0);
assertEquals(topLayer.getBoundingBoxes().size(), 1);
CRSEnvelope bbox = (CRSEnvelope) topLayer.getBoundingBoxes().get("CRS:84");
assertNotNull(bbox);
assertEquals(bbox.getEPSGCode(), "CRS:84");
assertEquals(bbox.getMinX(), -184, 0.0);
assertEquals(bbox.getMaxX(), 180, 0.0);
assertEquals(bbox.getMinY(), -90.0000000017335, 0.0);
assertEquals(bbox.getMaxY(), 90, 0.0);
Layer layer = (Layer) capabilities.getLayerList().get(1);
assertEquals(layer.getParent(), topLayer);
assertTrue(layer.isQueryable());
assertEquals(layer.getName(), "Bathymetry");
assertEquals(layer.getTitle(), "Bathymetry");
// Added test to verify inheritance, should be same as previous llbbox
llbbox = topLayer.getLatLonBoundingBox();
assertNotNull(llbbox);
assertEquals(llbbox.getMinX(), -180, 0.0);
assertEquals(llbbox.getMaxX(), 180, 0.0);
assertEquals(llbbox.getMinY(), -90, 0.0);
assertEquals(llbbox.getMaxY(), 90, 0.0);
bbox = (CRSEnvelope) layer.getBoundingBoxes().get("CRS:84");
assertNotNull(bbox);
assertEquals(bbox.getEPSGCode(), "CRS:84");
assertEquals(bbox.getMinX(), -180, 0.0);
assertEquals(bbox.getMaxX(), 180, 0.0);
assertEquals(bbox.getMinY(), -90, 0.0);
assertEquals(bbox.getMaxY(), 90, 0.0);
assertEquals(capabilities.getLayerList().size(), 21);
layer = (Layer) capabilities.getLayerList().get(20);
assertEquals(layer.getParent(), topLayer);
assertTrue(layer.isQueryable());
assertEquals(layer.getName(), "Ocean features");
assertEquals(layer.getTitle(), "Ocean features");