xmlbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ce...@apache.org
Subject svn commit: r292521 - in /xmlbeans/trunk/test: cases/xbean/xmlcursor/xquery/ src/misc/detailed/ src/xmlcursor/xquery/detailed/
Date Thu, 29 Sep 2005 19:41:21 GMT
Author: cezar
Date: Thu Sep 29 12:41:18 2005
New Revision: 292521

URL: http://svn.apache.org/viewcvs?rev=292521&view=rev
Log:
Contributed by Rajiv Balachandran. Changing xquery syntax in tests to avoid failures due to
$this variable not being declared

Modified:
    xmlbeans/trunk/test/cases/xbean/xmlcursor/xquery/Constructor.xq
    xmlbeans/trunk/test/cases/xbean/xmlcursor/xquery/Join.xq
    xmlbeans/trunk/test/src/misc/detailed/JiraRegression50_100Test.java
    xmlbeans/trunk/test/src/xmlcursor/xquery/detailed/StoreTestsXqrl.java
    xmlbeans/trunk/test/src/xmlcursor/xquery/detailed/XQueryTest.java

Modified: xmlbeans/trunk/test/cases/xbean/xmlcursor/xquery/Constructor.xq
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/cases/xbean/xmlcursor/xquery/Constructor.xq?rev=292521&r1=292520&r2=292521&view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/xmlcursor/xquery/Constructor.xq (original)
+++ xmlbeans/trunk/test/cases/xbean/xmlcursor/xquery/Constructor.xq Thu Sep 29 12:41:18 2005
@@ -1,4 +1,4 @@
-for $e in $this//employee
+for $e in .//employee
 return 
 		<person>
 			{ $e/name }

Modified: xmlbeans/trunk/test/cases/xbean/xmlcursor/xquery/Join.xq
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/cases/xbean/xmlcursor/xquery/Join.xq?rev=292521&r1=292520&r2=292521&view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/xmlcursor/xquery/Join.xq (original)
+++ xmlbeans/trunk/test/cases/xbean/xmlcursor/xquery/Join.xq Thu Sep 29 12:41:18 2005
@@ -1,9 +1,9 @@
-for $a in $this//employee
+for $a in .//employee
 return <result>
 		{ $a/ssn },
 		{ $a/name },
 		{
-		for $b in $this//employee 
+		for $b in .//employee 
 		where $b/ssn=$a/ssn and $a/name !=$b/name
 		return $b/name
 		}

Modified: xmlbeans/trunk/test/src/misc/detailed/JiraRegression50_100Test.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/src/misc/detailed/JiraRegression50_100Test.java?rev=292521&r1=292520&r2=292521&view=diff
==============================================================================
--- xmlbeans/trunk/test/src/misc/detailed/JiraRegression50_100Test.java (original)
+++ xmlbeans/trunk/test/src/misc/detailed/JiraRegression50_100Test.java Thu Sep 29 12:41:18
2005
@@ -511,8 +511,13 @@
                 "  </b> \n" +
                 "</doc> ";
         XmlObject xb80 = XmlObject.Factory.parse(xpathDoc);
+        // change $this to '.' to avoid XQuery syntax error for $this not being declared
+        //XmlObject[] resSet = xb80.selectPath("declare namespace " +
+        //        "ext='http://somebody.elses.extension'; $this//ext:a[@test='test']");
+
         XmlObject[] resSet = xb80.selectPath("declare namespace " +
-                "ext='http://somebody.elses.extension'; $this//ext:a[@test='test']");
+                "ext='http://somebody.elses.extension'; .//ext:a[@test='test']");
+
 
         Assert.assertTrue(resSet.length == 1);
         System.out.println("Result was: " + resSet[0].xmlText());
@@ -537,10 +542,13 @@
                 "  </MatchedRecord> \n" +
                 "</MatchedRecords> ";
         XmlObject xb81 = XmlObject.Factory.parse(xpathDoc);
-        XmlObject[] resSet = xb81.selectPath("$this//MatchedRecord[TableName=\"ABC\"]/TableName");
+        // change $this to '.' to avoid XQuery syntax error for $this not being declared
+        //XmlObject[] resSet = xb81.selectPath("$this//MatchedRecord[TableName=\"ABC\"]/TableName");
+        XmlObject[] resSet = xb81.selectPath(".//MatchedRecord[TableName=\"ABC\"]/TableName");
         assertEquals(resSet.length , 1);
         XmlCursor cursor = xb81.newCursor();
-        cursor.selectPath("$this//MatchedRecord[TableName=\"ABC\"]/TableName");
+        //cursor.selectPath("$this//MatchedRecord[TableName=\"ABC\"]/TableName");
+        cursor.selectPath(".//MatchedRecord[TableName=\"ABC\"]/TableName");
     }
 
     /**

Modified: xmlbeans/trunk/test/src/xmlcursor/xquery/detailed/StoreTestsXqrl.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/src/xmlcursor/xquery/detailed/StoreTestsXqrl.java?rev=292521&r1=292520&r2=292521&view=diff
==============================================================================
--- xmlbeans/trunk/test/src/xmlcursor/xquery/detailed/StoreTestsXqrl.java (original)
+++ xmlbeans/trunk/test/src/xmlcursor/xquery/detailed/StoreTestsXqrl.java Thu Sep 29 12:41:18
2005
@@ -35,7 +35,8 @@
         throws Exception
     {
         XmlCursor c = XmlObject.Factory.parse( xml ).newCursor();
-        String s = c.execQuery( "$this" ).xmlText();
+        //String s = c.execQuery( "$this" ).xmlText();
+        String s = c.execQuery( "." ).xmlText();
         Assert.assertTrue( s.equals( xml ) );
     }
     
@@ -120,7 +121,8 @@
         c.toStartDoc();
         
         Assert.assertTrue(
-            c.execQuery( "$this" ).
+            //c.execQuery( "$this" ).
+            c.execQuery( "." ).
                 xmlText().equals(
                     "<foo><boo:boo xmlns:boo=\"boo.com\"/></foo>" ) );
     }
@@ -158,7 +160,8 @@
 
         c = x.newCursor();
 
-        c.selectPath( "$this//@x" );
+        //c.selectPath( "$this//@x" );
+        c.selectPath( ".//@x" );
 
         Assert.assertTrue( c.toNextSelection() );
         Assert.assertTrue( c.currentTokenType().isAttr() );

Modified: xmlbeans/trunk/test/src/xmlcursor/xquery/detailed/XQueryTest.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/src/xmlcursor/xquery/detailed/XQueryTest.java?rev=292521&r1=292520&r2=292521&view=diff
==============================================================================
--- xmlbeans/trunk/test/src/xmlcursor/xquery/detailed/XQueryTest.java (original)
+++ xmlbeans/trunk/test/src/xmlcursor/xquery/detailed/XQueryTest.java Thu Sep 29 12:41:18
2005
@@ -147,7 +147,8 @@
     public void testTextSequenceRoot()
             throws XmlException,
             IOException {
-        String query = "$this//text()";
+        //String query = "$this//text()";
+        String query = ".//text()";
         InputStream input = JarUtil.getResourceFromJarasStream("xbean/xmlcursor/XQueryInput.xml");
         XmlObject o = XmlObject.Factory.parse(input);
         XmlObject[] res = o.execQuery(query);
@@ -172,7 +173,8 @@
     public void testDocumentFunc()
             throws XmlException,
             IOException {
-        String query = "<result>{$this},{count(//employee)}</result>";
+        //String query = "<result>{$this},{count(//employee)}</result>";
+        String query = "<result>{.},{count(//employee)}</result>";
         InputStream input = JarUtil.getResourceFromJarasStream("xbean/xmlcursor/XQueryInput.xml");
         XmlCursor c = XmlObject.Factory.parse(input).newCursor();
         XmlCursor c1 = c.execQuery(query);
@@ -184,7 +186,8 @@
 
 
     public void testTextAtOddPlaces() throws Exception {
-        String query = "<result>{$this},{count(//employee)}</result>";
+        //String query = "<result>{$this},{count(//employee)}</result>";
+        String query = "<result>{.},{count(//employee)}</result>";
         String input = "<foo><a><b>text</b>more text</a></foo>";
         XmlObject o = XmlObject.Factory.parse(input);
         XmlCursor c = o.newCursor();
@@ -228,7 +231,8 @@
                 "      </dept>\n" +
                 "};\n" +
                 "\n" +
-                "local:summary($this//employee[location = \"Denver\"])";
+                //"local:summary($this//employee[location = \"Denver\"])";
+                "local:summary(.//employee[location = \"Denver\"])";
 
         String xml = " <list>" +
                 "<employee>" +



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org


Mime
View raw message