public Set getCapabilitiesCrsList() { return new TreeSet(wms.getSRS()); //return new TreeSet(capabilitiesCrsList); }
@Override protected WMSInfo initialize(WMSInfo service) { super.initialize(service); final Version version_1_1_1 = WMS.VERSION_1_1_1; final Version version_1_3_0 = WMS.VERSION_1_3_0; if (!service.getVersions().contains(version_1_1_1)) { service.getVersions().add(version_1_1_1); } if (!service.getVersions().contains(version_1_3_0)) { service.getVersions().add(version_1_3_0); } if (service.getSRS() == null) { ((WMSInfoImpl) service).setSRS(new ArrayList<String>()); } if (service.getGetFeatureInfoMimeTypes() == null) { ((WMSInfoImpl) service).setGetFeatureInfoMimeTypes(new HashSet<String>()); } if (service.getGetMapMimeTypes() == null) { ((WMSInfoImpl) service).setGetMapMimeTypes(new HashSet<String>()); } if (service.getInterpolation() == null) { service.setInterpolation(WMSInterpolation.Nearest); } return service; }
properties.put("authorityURLs", wmsInfo.getAuthorityURLs() != null ? new CollectionModel(wmsInfo.getAuthorityURLs(), new ObjectToMapWrapper(AuthorityURL.class)) : "NO_AUTHORITY_URL"); properties.put("identifiers", wmsInfo.getIdentifiers() != null ? new CollectionModel(wmsInfo.getIdentifiers(), new ObjectToMapWrapper(LayerIdentifierInfo.class)) : "NO_IDENTIFIER"); properties.put("srsList", wmsInfo.getSRS().size() > 0 ? wmsInfo.getSRS() : "NO_SRSList"); properties.put("bboxForEachCRS", wmsInfo.isBBOXForEachCRS().toString()); properties.put("interpolation", wmsInfo.getInterpolation().name());
@Override protected void oneTimeSetUp() throws Exception { super.oneTimeSetUp(); Map<String, String> namespaces = new HashMap<String, String>(); namespaces.put("wms", "http://www.opengis.net/wms"); namespaces.put("ows", "http://www.opengis.net/ows"); namespaces.put("xlink", "http://www.w3.org/1999/xlink"); namespaces.put("ogc", "http://www.opengis.net/ogc"); namespaces.put("", "http://www.opengis.net/ogc"); namespaces.put("wfs", "http://www.opengis.net/wfs"); namespaces.put("xsi", "http://www.w3.org/2001/XMLSchema-instance"); getTestData().registerNamespaces(namespaces); XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(namespaces)); // setup limited srs GeoServer gs = getGeoServer(); WMSInfo wms = gs.getService(WMSInfo.class); wms.getSRS().add("EPSG:4326"); gs.save(wms); }
@Override protected void onSetUp(SystemTestData testData) throws Exception { super.onSetUp(testData); // add org.geoserver.catalog.testReader.CustomFormat coverage String styleName = "temperature"; testData.addStyle(styleName, "../temperature.sld", getClass(), getCatalog()); Map propertyMap = new HashMap(); propertyMap.put(LayerProperty.STYLE, "temperature"); testData.addRasterLayer( WATTEMP, "custwatertemp.zip", null, propertyMap, SystemTestData.class, getCatalog()); GeoServerInfo global = getGeoServer().getGlobal(); global.getSettings().setProxyBaseUrl("src/test/resources/geoserver"); getGeoServer().save(global); WMSInfo wms = getGeoServer().getService(WMSInfo.class); wms.getSRS().add("EPSG:4326"); getGeoServer().save(wms); Map<String, String> namespaces = new HashMap<String, String>(); namespaces.put("xlink", "http://www.w3.org/1999/xlink"); namespaces.put("", "http://www.opengis.net/wms"); namespaces.put("wms", "http://www.opengis.net/wms"); getTestData().registerNamespaces(namespaces); XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(namespaces)); }
@Override protected void onSetUp(SystemTestData testData) throws Exception { super.onSetUp(testData); // add org.geoserver.catalog.testReader.CustomFormat coverage String styleName = "temperature"; testData.addStyle(styleName, "../temperature.sld", getClass(), getCatalog()); Map propertyMap = new HashMap(); propertyMap.put(LayerProperty.STYLE, "temperature"); testData.addRasterLayer( WATTEMP, "watertempDynamicDims.zip", null, propertyMap, SystemTestData.class, getCatalog()); GeoServerInfo global = getGeoServer().getGlobal(); global.getSettings().setProxyBaseUrl("src/test/resources/geoserver"); getGeoServer().save(global); WMSInfo wms = getGeoServer().getService(WMSInfo.class); wms.getSRS().add("EPSG:4326"); getGeoServer().save(wms); Map<String, String> namespaces = new HashMap<String, String>(); namespaces.put("xlink", "http://www.w3.org/1999/xlink"); namespaces.put("", "http://www.opengis.net/wms"); namespaces.put("wms", "http://www.opengis.net/wms"); getTestData().registerNamespaces(namespaces); XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(namespaces)); }
public void testChangeMediaType() throws Exception { WMSInfo wms = getGeoServer().getService(WMSInfo.class); wms.getSRS().add("EPSG:4326"); wms.getMetadata().put(InspireMetadata.LANGUAGE.key, "fre"); wms.getMetadata().put(InspireMetadata.SERVICE_METADATA_URL.key, "http://foo.com?bar=baz"); getGeoServer().save(wms); Document dom = getAsDOM("wms?request=getcapabilities"); assertEquals(NAMESPACE, dom.getDocumentElement().getAttribute("xmlns:inspire_vs")); assertMetadataUrlAndMediaType(dom, "http://foo.com?bar=baz", "application/vnd.iso.19139+xml"); wms.getMetadata().put(InspireMetadata.SERVICE_METADATA_TYPE.key, "application/xml"); getGeoServer().save(wms); dom = getAsDOM("wms?request=getcapabilities"); assertEquals(NAMESPACE, dom.getDocumentElement().getAttribute("xmlns:inspire_vs")); assertMetadataUrlAndMediaType(dom, "http://foo.com?bar=baz", "application/xml"); }
@Override protected void onSetUp(SystemTestData testData) throws Exception { super.onSetUp(testData); // add org.geoserver.catalog.testReader.CustomFormat coverage String styleName = "temperature"; testData.addStyle(styleName, "../temperature.sld", getClass(), getCatalog()); Map propertyMap = new HashMap(); propertyMap.put(LayerProperty.STYLE, "temperature"); testData.addRasterLayer( WATTEMP, "custwatertemp.zip", null, propertyMap, SystemTestData.class, getCatalog()); GeoServerInfo global = getGeoServer().getGlobal(); global.getSettings().setProxyBaseUrl("src/test/resources/geoserver"); getGeoServer().save(global); WMSInfo wms = getGeoServer().getService(WMSInfo.class); wms.getSRS().add("EPSG:4326"); getGeoServer().save(wms); Map<String, String> namespaces = new HashMap<String, String>(); namespaces.put("xlink", "http://www.w3.org/1999/xlink"); namespaces.put("", "http://www.opengis.net/wms"); namespaces.put("wms", "http://www.opengis.net/wms"); getTestData().registerNamespaces(namespaces); XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(namespaces)); }
public void testExtendedCaps() throws Exception { WMSInfo wms = getGeoServer().getService(WMSInfo.class); wms.getSRS().add("EPSG:4326"); wms.getMetadata().put(InspireMetadata.LANGUAGE.key, "fre"); wms.getMetadata().put(InspireMetadata.SERVICE_METADATA_URL.key, "http://foo.com?bar=baz"); getGeoServer().save(wms); Document dom = getAsDOM("wms?request=getcapabilities"); assertEquals(NAMESPACE, dom.getDocumentElement().getAttribute("xmlns:inspire_vs")); final Element extendedCaps = getFirstElementByTagName(dom, "inspire_vs:ExtendedCapabilities"); assertNotNull(extendedCaps); final Element mdUrl = getFirstElementByTagName(extendedCaps, "inspire_common:MetadataUrl"); assertNotNull(mdUrl); final Element url = getFirstElementByTagName(mdUrl, "inspire_common:URL"); assertNotNull(url); assertEquals("http://foo.com?bar=baz", url.getFirstChild().getNodeValue()); final Element suppLangs = getFirstElementByTagName(extendedCaps, "inspire_common:SupportedLanguages"); assertNotNull(suppLangs); final Element defLang = getFirstElementByTagName(suppLangs, "inspire_common:DefaultLanguage"); assertNotNull(defLang); final Element defLangVal = getFirstElementByTagName(defLang, "inspire_common:Language"); assertEquals("fre", defLangVal.getFirstChild().getNodeValue()); final Element respLang = getFirstElementByTagName(extendedCaps, "inspire_common:ResponseLanguage"); assertNotNull(respLang); final Element respLangVal = getFirstElementByTagName(defLang, "inspire_common:Language"); assertEquals("fre", respLangVal.getFirstChild().getNodeValue()); }
wms.getSRS().add("EPSG:4326"); getGeoServer().save(wms);