David Winslow ha scritto:
With the one-time setup enabled, this test and several others fail for me. When I ran without one-time setup they all passed.
$ mvn -version
Apache Maven 2.2.1 (r801777; 2009-08-06 14:16:01-0500)
Java version: 1.6.0_13
Java home: /home/dwins/opt/jdk1.6.0_13/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.31.12-174.2.3.fc12.x86_64" arch: "i386" Family: "unix"
Hum, I did not get a conclusive answer but I can propose a debugging
technique and narrowed down the problem a bit, this may be of help.
Tried from Eclipse, it works fine with or without one time setup,
with jdk 1.5 and jdk 6 (on a 64bit machine)
Doing a full build from maven on the command line, with jdk 1.5
and one time setup, actually fails for me too.
However, if I run the wfs 1.1 GetFeatureTest alone:
mvn test -Dtest=org.geoserver.wfs.v1_1.GetFeatureTest
it works fine.
Maven uses the same virtual machine to run all the tests,
so probably the cause has to be searched into something
that has been left dirty by a previously run test, something
statically cached between runs.
The errors contained in the surefire reports are:
org.xml.sax.SAXParseException: The prefix "null" for element "null:NamedPlaces" is not bound.
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:98)
at org.geoserver.test.GeoServerAbstractTestSupport.dom(GeoServerAbstractTestSupport.java:811)
at org.geoserver.test.GeoServerAbstractTestSupport.getAsDOM(GeoServerAbstractTestSupport.java:718)
at org.geoserver.test.GeoServerAbstractTestSupport.getAsDOM(GeoServerAbstractTestSupport.java:680)
at org.geoserver.wfs.v1_1.GetFeatureTest.testGetWithFeatureId(GetFeatureTest.java:77)
Since this is not happening in WFS 1.0 tests my hunch would be
that the XSD driven encoder schemas cache is somehow dirty?
I've then tried to run the minimum amount of tests that still triggers
the issue with:
mvn test -Dtest="GetFeature*Test"
and then enabled surefire debugging with:
mvn test -Dtest="GetFeature*Test" -Dmaven.surefire.debug
(see details at http://maven.apache.org/plugins/maven-surefire-plugin/examples/debugging.html)
started Eclipse in remote debugging mode from the WFS module
and added a breakpoint in testGetWithFeatureId() and looked
at the response before the DOM is parsed, the first GET
request in the test goes fine but the second returns:
<?xml version="1.0" encoding="UTF-8"?>
<wfs:FeatureCollection numberOfFeatures="1" timeStamp="2010-02-02T15:35:37.328+01:00" xsi:schemaLocation="http://www.opengis.net/cite http://localhost:8080/geoserver/wfs?service=WFS&version=1.1.0&request=DescribeFeatureType&typeName=cite%3ANamedPlaces http://www.opengis.net/wfs http://localhost:8080/geoserver/schemas/wfs/1.1.0/wfs.xsd" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" xmlns:cdf="http://www.opengis.net/cite/data" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ows="http://www.opengis.net/ows" xmlns:wfs="http://www.opengis.net/wfs"><gml:featureMembers><null:NamedPlaces gml:id="NamedPlaces.1107531895891"><null:the_geom><gml:MultiPolygon srsName="urn:x-ogc:def:crs:EPSG:4326"><gml:polygonMember><gml:Polygon><gml:exterior><gml:LinearRing><gml:posList>-0.0011 0.0017 -6.0E-4 0.0017 -6.0E-4 0.0025 -0.0011 0.0025 -0.0011 0.0017</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></gml:polygonMember></gml:MultiPolygon></null:the_geom><null:FID>118</null:FID><null:NAME>Goose Island</null:NAME></null:NamedPlaces></gml:featureMembers></wfs:FeatureCollection>
So, I don't know exactly what is going on but it would
seems something is at odds specifically with NamedPlaces.
Cheers
Andrea
--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.