-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from opengeospatial/feature-issue#16
Updated test to count the features from the ESRI response.
- Loading branch information
Showing
6 changed files
with
158 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
...e/latlon/ets/wms13/core/dgiwg/testsuite/getfeatureinfo/BaseGetFeatureInfoFixtureTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package de.latlon.ets.wms13.core.dgiwg.testsuite.getfeatureinfo; | ||
|
||
import static org.hamcrest.CoreMatchers.is; | ||
import static org.junit.Assert.assertThat; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
|
||
import javax.xml.parsers.DocumentBuilder; | ||
import javax.xml.parsers.DocumentBuilderFactory; | ||
import javax.xml.parsers.ParserConfigurationException; | ||
|
||
import org.junit.Test; | ||
import org.w3c.dom.Document; | ||
import org.w3c.dom.NodeList; | ||
import org.xml.sax.InputSource; | ||
import org.xml.sax.SAXException; | ||
|
||
/** | ||
* @author <a href="mailto:goltz@lat-lon.de">Lyn Goltz </a> | ||
*/ | ||
public class BaseGetFeatureInfoFixtureTest { | ||
|
||
@Test | ||
public void testParseFeatureMemberNodes_esri() | ||
throws Exception { | ||
BaseGetFeatureInfoFixture baseGetFeatureInfoFixture = new BaseGetFeatureInfoFixture(); | ||
Document documentEntity = parseDocument( "gfi-response_esri.xml" ); | ||
NodeList nodeList = baseGetFeatureInfoFixture.parseFeatureMemberNodes( documentEntity ); | ||
|
||
assertThat( nodeList.getLength(), is( 1 ) ); | ||
} | ||
|
||
@Test | ||
public void testParseFeatureMemberNodes_gml() | ||
throws Exception { | ||
BaseGetFeatureInfoFixture baseGetFeatureInfoFixture = new BaseGetFeatureInfoFixture(); | ||
Document documentEntity = parseDocument( "gfi-response_gml.xml" ); | ||
NodeList nodeList = baseGetFeatureInfoFixture.parseFeatureMemberNodes( documentEntity ); | ||
|
||
assertThat( nodeList.getLength(), is( 2 ) ); | ||
} | ||
|
||
@Test | ||
public void testParseFeatureMemberNodes_gml32() | ||
throws Exception { | ||
BaseGetFeatureInfoFixture baseGetFeatureInfoFixture = new BaseGetFeatureInfoFixture(); | ||
Document documentEntity = parseDocument( "gfi-response_gml32.xml" ); | ||
NodeList nodeList = baseGetFeatureInfoFixture.parseFeatureMemberNodes( documentEntity ); | ||
|
||
assertThat( nodeList.getLength(), is( 2 ) ); | ||
} | ||
|
||
private Document parseDocument( String resource ) | ||
throws ParserConfigurationException, SAXException, IOException { | ||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); | ||
factory.setNamespaceAware( true ); | ||
DocumentBuilder builder = factory.newDocumentBuilder(); | ||
InputStream wmsCapabilities = getClass().getResourceAsStream( resource ); | ||
return builder.parse( new InputSource( wmsCapabilities ) ); | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
...t/resources/de/latlon/ets/wms13/core/dgiwg/testsuite/getfeatureinfo/gfi-response_esri.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<FeatureInfoResponse xmlns:esri_wms="http://www.esri.com/wms" xmlns="http://www.esri.com/wms"> | ||
<FIELDS OBJECTID="1" Shape="Polygon" Shape_Length="9.636801" Shape_Area="5.539155"></FIELDS> | ||
</FeatureInfoResponse> |
39 changes: 39 additions & 0 deletions
39
...st/resources/de/latlon/ets/wms13/core/dgiwg/testsuite/getfeatureinfo/gfi-response_gml.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<FeatureCollection xmlns="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml"> | ||
<gml:boundedBy> | ||
<gml:Envelope srsName="urn:ogc:def:crs:epsg::4326"> | ||
<gml:lowerCorner>51.589828 13.421406</gml:lowerCorner> | ||
<gml:upperCorner>51.600844 13.439423</gml:upperCorner> | ||
</gml:Envelope> | ||
</gml:boundedBy> | ||
<gml:featureMember> | ||
<xplan:BP_Bereich xmlns:xplan="http://www.deegree.org/xplanung/1/0" gml:id="XPLAN_BP_BEREICH_1"> | ||
<xplan:gmlId>XPLAN_BP_BEREICH_1</xplan:gmlId> | ||
<xplan:xpVersion>4.1</xplan:xpVersion> | ||
<xplan:xpPlanType>BP_Plan</xplan:xpPlanType> | ||
<xplan:xpPlanName>Abrundungssatzung_Test</xplan:xpPlanName> | ||
<xplan:inkrafttretensDatum>1999-05-17</xplan:inkrafttretensDatum> | ||
<xplan:nummer>0</xplan:nummer> | ||
<xplan:name>Teilbereich 1</xplan:name> | ||
<xplan:bedeutung>Sonstiges</xplan:bedeutung> | ||
<xplan:bedeutungCode>9999</xplan:bedeutungCode> | ||
<xplan:gehoertZuPlan>[XPLAN_BP_PLAN_1]</xplan:gehoertZuPlan> | ||
<xplan:rasterBasis>[/getAttachment?featureID=XPLAN_XP_EXTERNEREFERENZPLAN_1&filename=Abrundungssatzung_Test_ergb.tif]</xplan:rasterBasis> | ||
</xplan:BP_Bereich> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<xplan:BP_Bereich xmlns:xplan="http://www.deegree.org/xplanung/1/0" gml:id="XPLAN_BP_BEREICH_2"> | ||
<xplan:gmlId>XPLAN_BP_BEREICH_2</xplan:gmlId> | ||
<xplan:xpVersion>4.1</xplan:xpVersion> | ||
<xplan:xpPlanType>BP_Plan</xplan:xpPlanType> | ||
<xplan:xpPlanName>Abrundungssatzung_Test</xplan:xpPlanName> | ||
<xplan:inkrafttretensDatum>1999-05-17</xplan:inkrafttretensDatum> | ||
<xplan:nummer>0</xplan:nummer> | ||
<xplan:name>Teilbereich 2</xplan:name> | ||
<xplan:bedeutung>Sonstiges</xplan:bedeutung> | ||
<xplan:bedeutungCode>9999</xplan:bedeutungCode> | ||
<xplan:gehoertZuPlan>[XPLAN_BP_PLAN_2]</xplan:gehoertZuPlan> | ||
<xplan:rasterBasis>[/getAttachment?featureID=XPLAN_XP_EXTERNEREFERENZPLAN_2&filename=Abrundungssatzung_Test_ergb.tif]</xplan:rasterBasis> | ||
</xplan:BP_Bereich> | ||
</gml:featureMember> | ||
</FeatureCollection> |
39 changes: 39 additions & 0 deletions
39
.../resources/de/latlon/ets/wms13/core/dgiwg/testsuite/getfeatureinfo/gfi-response_gml32.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<FeatureCollection xmlns="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml/3.2"> | ||
<gml:boundedBy> | ||
<gml:Envelope srsName="urn:ogc:def:crs:epsg::4326"> | ||
<gml:lowerCorner>51.589828 13.421406</gml:lowerCorner> | ||
<gml:upperCorner>51.600844 13.439423</gml:upperCorner> | ||
</gml:Envelope> | ||
</gml:boundedBy> | ||
<gml:featureMember> | ||
<xplan:BP_Bereich xmlns:xplan="http://www.deegree.org/xplanung/1/0" gml:id="XPLAN_BP_BEREICH_1"> | ||
<xplan:gmlId>XPLAN_BP_BEREICH_1</xplan:gmlId> | ||
<xplan:xpVersion>4.1</xplan:xpVersion> | ||
<xplan:xpPlanType>BP_Plan</xplan:xpPlanType> | ||
<xplan:xpPlanName>Abrundungssatzung_Test</xplan:xpPlanName> | ||
<xplan:inkrafttretensDatum>1999-05-17</xplan:inkrafttretensDatum> | ||
<xplan:nummer>0</xplan:nummer> | ||
<xplan:name>Teilbereich 1</xplan:name> | ||
<xplan:bedeutung>Sonstiges</xplan:bedeutung> | ||
<xplan:bedeutungCode>9999</xplan:bedeutungCode> | ||
<xplan:gehoertZuPlan>[XPLAN_BP_PLAN_1]</xplan:gehoertZuPlan> | ||
<xplan:rasterBasis>[/getAttachment?featureID=XPLAN_XP_EXTERNEREFERENZPLAN_1&filename=Abrundungssatzung_Test_ergb.tif]</xplan:rasterBasis> | ||
</xplan:BP_Bereich> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<xplan:BP_Bereich xmlns:xplan="http://www.deegree.org/xplanung/1/0" gml:id="XPLAN_BP_BEREICH_2"> | ||
<xplan:gmlId>XPLAN_BP_BEREICH_2</xplan:gmlId> | ||
<xplan:xpVersion>4.1</xplan:xpVersion> | ||
<xplan:xpPlanType>BP_Plan</xplan:xpPlanType> | ||
<xplan:xpPlanName>Abrundungssatzung_Test</xplan:xpPlanName> | ||
<xplan:inkrafttretensDatum>1999-05-17</xplan:inkrafttretensDatum> | ||
<xplan:nummer>0</xplan:nummer> | ||
<xplan:name>Teilbereich 2</xplan:name> | ||
<xplan:bedeutung>Sonstiges</xplan:bedeutung> | ||
<xplan:bedeutungCode>9999</xplan:bedeutungCode> | ||
<xplan:gehoertZuPlan>[XPLAN_BP_PLAN_2]</xplan:gehoertZuPlan> | ||
<xplan:rasterBasis>[/getAttachment?featureID=XPLAN_XP_EXTERNEREFERENZPLAN_2&filename=Abrundungssatzung_Test_ergb.tif]</xplan:rasterBasis> | ||
</xplan:BP_Bereich> | ||
</gml:featureMember> | ||
</FeatureCollection> |