Source:
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, "<LINK_0>"); getGeoServer().save(wms); Document dom = getAsDOM("wms?request=getcapabilities"); assertEquals(VS_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("<LINK_0>", 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()); }

Target:
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, "<LINK_0>"); getGeoServer().save(wms); Document dom = getAsDOM("wms?request=getcapabilities"); assertEquals(VS_NAMESPACE, dom.getDocumentElement().getAttribute("xmlns:inspire_vs")); String schemaLocation = dom.getDocumentElement().getAttribute("xsi:schemaLocation"); assertTrue(schemaLocation.contains(VS_NAMESPACE)); String[] schemaLocationParts = schemaLocation.split("\\s+"); for (int i = 0; i < schemaLocationParts .length; i++) { if (schemaLocationParts[i].equals(VS_NAMESPACE)) { assertTrue(schemaLocationParts[i+1].equals(VS_SCHEMA)); } } 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("<LINK_0>", 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()); }