[mapserver-commits] r12930 - trunk/mapserver/mapscript/java/examples

svn at osgeo.org svn at osgeo.org
Thu Dec 29 03:36:19 EST 2011


Author: unicoletti
Date: 2011-12-29 00:36:19 -0800 (Thu, 29 Dec 2011)
New Revision: 12930

Modified:
   trunk/mapserver/mapscript/java/examples/QueryByAttribute.java
   trunk/mapserver/mapscript/java/examples/QueryByAttributeUnicode.java
Log:
working on #4139 : extended tests to catch a regression issue introduced by #3647

Modified: trunk/mapserver/mapscript/java/examples/QueryByAttribute.java
===================================================================
--- trunk/mapserver/mapscript/java/examples/QueryByAttribute.java	2011-12-28 17:47:52 UTC (rev 12929)
+++ trunk/mapserver/mapscript/java/examples/QueryByAttribute.java	2011-12-29 08:36:19 UTC (rev 12930)
@@ -1,6 +1,7 @@
 import edu.umn.gis.mapscript.imageObj;
 import edu.umn.gis.mapscript.mapObj;
 import edu.umn.gis.mapscript.layerObj;
+import edu.umn.gis.mapscript.shapeObj;
 import edu.umn.gis.mapscript.mapscriptConstants;
 
 
@@ -22,7 +23,12 @@
 	layer.queryByAttributes(map,"FNAME", filter, mapscriptConstants.MS_MULTIPLE);
 	layer.open();
 	System.out.println( "Searched for: " +filter );        
-	System.out.println( "Results number (should be always 1): " +layer.getNumResults() );
+	int results=layer.getNumResults();
+	System.out.println( "Results number (should be always 1): " +results );
+	for(int i=0;i<results;i++) {
+		shapeObj shape=layer.getShape(layer.getResult(i));
+		System.out.println( "shape["+i+"]=" +shape );
+	}
 	layer.close();
 
 

Modified: trunk/mapserver/mapscript/java/examples/QueryByAttributeUnicode.java
===================================================================
--- trunk/mapserver/mapscript/java/examples/QueryByAttributeUnicode.java	2011-12-28 17:47:52 UTC (rev 12929)
+++ trunk/mapserver/mapscript/java/examples/QueryByAttributeUnicode.java	2011-12-29 08:36:19 UTC (rev 12930)
@@ -38,7 +38,13 @@
 			layer.queryByAttributes(map,"KREIS_NAME", filter, mapscriptConstants.MS_MULTIPLE);
 			layer.open();
 
-			System.out.println( "Results number (should be always 1): " +layer.getNumResults() );
+        		int results=layer.getNumResults();
+		        System.out.println( "Results number (should be always 1): " +results );
+        		for(int i=0;i<results;i++) {
+                		shapeObj shape=layer.getShape(layer.getResult(i));
+		                System.out.println( "shape["+i+"]=" +shape );
+        		}
+
 			layer.close();     
 		}
 	}



More information about the mapserver-commits mailing list