svn - r34303 - trunk/modules/unsupported/app-schema/app-schema/src/test/java/org/geotools/data/complex

1 message Options
Embed this post
Permalink
svn_geotools

svn - r34303 - trunk/modules/unsupported/app-schema/app-schema/src/test/java/org/geotools/data/complex

Reply Threaded More More options
Print post
Permalink
Author: bencaradocdavies
Date: 2009-11-02 01:15:54 -0500 (Mon, 02 Nov 2009)
New Revision: 34303

Modified:
   trunk/modules/unsupported/app-schema/app-schema/src/test/java/org/geotools/data/complex/XmlDataStoreTest.java
Log:
Fix for Java 6 build failure GEOT-2777: XmlDataStoreTest fails from maven build

Modified: trunk/modules/unsupported/app-schema/app-schema/src/test/java/org/geotools/data/complex/XmlDataStoreTest.java
===================================================================
--- trunk/modules/unsupported/app-schema/app-schema/src/test/java/org/geotools/data/complex/XmlDataStoreTest.java 2009-11-02 05:59:38 UTC (rev 34302)
+++ trunk/modules/unsupported/app-schema/app-schema/src/test/java/org/geotools/data/complex/XmlDataStoreTest.java 2009-11-02 06:15:54 UTC (rev 34303)
@@ -132,8 +132,8 @@
         assertNotNull(mappedFeatureType);
     }
 
-    public void XtestFilterTranslation() throws Exception {
-        final String expectedTranslatedFilter = getExpectedFilter();
+    public void testFilterTranslation() throws Exception {
+      //tests that the translation of the filter from GeoSciML to the xml datasorce works.
         Filter inputFilter = ff.equals(ff.property("gml:name"), ff
                 .literal("Unit Name1233811724109 UC1233811724109 description name"));
         
@@ -149,7 +149,8 @@
 
         assertEquals(MAX_FEATURES, query.getMaxFeatures());
         String translatedFilter = query.getFilter().toString();
-        assertEquals(expectedTranslatedFilter, translatedFilter);
+        assertTrue(getExpectedFilter().equals(translatedFilter) ||
+                getReversedExpectedFilter().equals(translatedFilter));
     }
 
     public void testFeatureCounting() throws Exception {
@@ -166,7 +167,7 @@
         assertEquals(ls.size(), size);
     }
 
-    public void XtestNoElementsReturned() throws Exception {
+    public void testNoElementsReturned() throws Exception {
         final Filter filter = ff.equals(ff.property("gml:name"), ff
                 .literal("Unit Name1233811724109 UC1233811724109 description name"));
 
@@ -187,7 +188,7 @@
         assertEquals(ls.size(), results.size());
     }
 
-    public void XtestFeaturesCreatedCorrectly() throws Exception {
+    public void testFeaturesCreatedCorrectly() throws Exception {
         final Name GeologicUnitName = new NameImpl(GSMLNS, "GeologicUnit");
         final Name GeologicUnitType = new NameImpl(GSMLNS, "GeologicUnitType");
         final Filter filter = ff.equals(ff.property("gml:name"), ff
@@ -646,6 +647,16 @@
                 + "gss:urn[@domain='GSV'] = Unit Name1233811724109 UC1233811724109 description name ]]";
     }
 
+    private String getReversedExpectedFilter() {
+        final String prefix = "/soapenv:Envelope/soapenv:Body/qaz:getGeologicalFeaturesByFilterStringResponse/qaz:out/qaz:item/";
+        return "[[ "
+                + prefix
+                + "gss:urn[@domain='GSV'] = Unit Name1233811724109 UC1233811724109 description name ] OR "
+                + "[ "
+                + prefix
+                + "gss:formattedName = Unit Name1233811724109 UC1233811724109 description name ]]";
+    }
+    
     private FeatureCollection getFeatures(final int maxFeatures, Filter inputFilter)
             throws Exception {
         FeatureSource fSource = (FeatureSource) mappingDataStore.getFeatureSource(typeName);


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
GeoTools-commits mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-commits