You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by th...@apache.org on 2014/01/30 15:56:02 UTC

svn commit: r1562848 - /jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/query/QueryFulltextTest.java

Author: thomasm
Date: Thu Jan 30 14:56:01 2014
New Revision: 1562848

URL: http://svn.apache.org/r1562848
Log:
OAK-1369 XPath queries: fail if a @ is missing in front of property names (fix test case)

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/query/QueryFulltextTest.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/query/QueryFulltextTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/query/QueryFulltextTest.java?rev=1562848&r1=1562847&r2=1562848&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/query/QueryFulltextTest.java (original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/query/QueryFulltextTest.java Thu Jan 30 14:56:01 2014
@@ -61,33 +61,37 @@ public class QueryFulltextTest extends A
         Row row;
         String s;
         
-        String xpath = "//*[jcr:contains(., 'hello')]/rep:excerpt(.) order by jcr:path descending";
+        String xpath = "//*[jcr:contains(., 'hello')]/rep:excerpt(.) order by @jcr:path";
         
         q = qm.createQuery(xpath, "xpath");
         it = q.execute().getRows();
         row = it.nextRow();
+        String path = row.getPath();
         s = row.getValue("rep:excerpt(.)").getString();
-        assertTrue(s, s.indexOf("<strong>hello</strong> world") >= 0);
-        assertTrue(s, s.indexOf("description") >= 0);
+        assertTrue(path + ":" + s + " (1)", s.indexOf("<strong>hello</strong> world") >= 0);
+        assertTrue(path + ":" + s + " (2)", s.indexOf("description") >= 0);
         row = it.nextRow();
+        path = row.getPath();
         s = row.getValue("rep:excerpt(.)").getString();
         // TODO is this expected?
-        assertTrue(s, s.indexOf("Hello World") >= 0);
-        assertTrue(s, s.indexOf("Description") >= 0);
+        assertTrue(path + ":" + s + " (3)", s.indexOf("Hello World") >= 0);
+        assertTrue(path + ":" + s + " (4)", s.indexOf("Description") >= 0);
         
-        xpath = "//*[jcr:contains(., 'hello')]/rep:excerpt(.) order by jcr:path descending";
+        xpath = "//*[jcr:contains(., 'hello')]/rep:excerpt(.) order by @jcr:path";
 
         q = qm.createQuery(xpath, "xpath");
         it = q.execute().getRows();
         row = it.nextRow();
+        path = row.getPath();
         s = row.getValue("rep:excerpt(text)").getString();
-        assertTrue(s, s.indexOf("<strong>hello</strong> world") >= 0);
-        assertTrue(s, s.indexOf("description") < 0);
+        assertTrue(path + ":" + s + " (5)", s.indexOf("<strong>hello</strong> world") >= 0);
+        assertTrue(path + ":" + s + " (6)", s.indexOf("description") < 0);
         row = it.nextRow();
+        path = row.getPath();
         s = row.getValue("rep:excerpt(text)").getString();
         // TODO is this expected?
-        assertTrue(s, s.indexOf("Hello World") >= 0);
-        assertTrue(s, s.indexOf("Description") < 0);
+        assertTrue(path + ":" + s + " (7)", s.indexOf("Hello World") >= 0);
+        assertTrue(path + ":" + s + " (8)", s.indexOf("Description") < 0);
     }
     
     @Test