From 76e4381cec554dc0d9a13b90e37a0fee837d2a14 Mon Sep 17 00:00:00 2001 From: Keshav Nangare Date: Tue, 7 Aug 2018 16:59:18 +0530 Subject: [PATCH] Updated test to count the features from the ESRI response. --- .../getfeatureinfo/BaseGetFeatureInfoFixture.java | 7 ++++++- .../de/latlon/ets/wms13/core/domain/WmsNamespaces.java | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/latlon/ets/wms13/core/dgiwg/testsuite/getfeatureinfo/BaseGetFeatureInfoFixture.java b/src/main/java/de/latlon/ets/wms13/core/dgiwg/testsuite/getfeatureinfo/BaseGetFeatureInfoFixture.java index 7c8821b..b1a20bc 100644 --- a/src/main/java/de/latlon/ets/wms13/core/dgiwg/testsuite/getfeatureinfo/BaseGetFeatureInfoFixture.java +++ b/src/main/java/de/latlon/ets/wms13/core/dgiwg/testsuite/getfeatureinfo/BaseGetFeatureInfoFixture.java @@ -32,8 +32,13 @@ public void buildGetMapRequest() { protected NodeList parseFeatureMemberNodes( Document entity ) throws XPathFactoryConfigurationException, XPathExpressionException { String xPathAbstract = "//gml:featureMember"; + NodeList featureMemberList = null; XPath xpath = createXPath(); - return (NodeList) xpath.evaluate( xPathAbstract, entity, XPathConstants.NODESET ); + featureMemberList = (NodeList) xpath.evaluate( xPathAbstract, entity, XPathConstants.NODESET ); + if(featureMemberList == null || featureMemberList.getLength() == 0){ + featureMemberList = (NodeList) xpath.evaluate( "esri:FeatureInfoResponse//esri:FIELDS", entity, XPathConstants.NODESET ); + } + return featureMemberList; } protected XPath createXPath() diff --git a/src/main/java/de/latlon/ets/wms13/core/domain/WmsNamespaces.java b/src/main/java/de/latlon/ets/wms13/core/domain/WmsNamespaces.java index 6dc1daf..3d60380 100644 --- a/src/main/java/de/latlon/ets/wms13/core/domain/WmsNamespaces.java +++ b/src/main/java/de/latlon/ets/wms13/core/domain/WmsNamespaces.java @@ -24,6 +24,9 @@ private WmsNamespaces() { /** GML */ public static final String GML = "http://www.opengis.net/gml"; + + /** ESRI */ + public static final String ESRI = "http://www.esri.com/wms"; /** ExtendedCapabilities Namespace used for SOAP binding */ public static final String SOAPWMS = "http://schemas.deegree.org/extensions/services/wms/1.3.0"; @@ -45,6 +48,7 @@ public static NamespaceBindings withStandardBindings() { nsBindings.addNamespaceBinding( XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI, "xsi" ); nsBindings.addNamespaceBinding( WmsNamespaces.GML, "gml" ); nsBindings.addNamespaceBinding( WmsNamespaces.SOAPWMS, "soapwms" ); + nsBindings.addNamespaceBinding( WmsNamespaces.ESRI, "esri" ); return nsBindings; }