jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexparvule...@apache.org
Subject svn commit: r1371132 - /jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/OrderByTest.java
Date Thu, 09 Aug 2012 10:02:50 GMT
Author: alexparvulescu
Date: Thu Aug  9 10:02:50 2012
New Revision: 1371132

URL: http://svn.apache.org/viewvc?rev=1371132&view=rev
Log:
JCR-3408 Query tests should avoid casting to QueryManagerImpl

Modified:
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/OrderByTest.java

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/OrderByTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/OrderByTest.java?rev=1371132&r1=1371131&r2=1371132&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/OrderByTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/OrderByTest.java
Thu Aug  9 10:02:50 2012
@@ -32,7 +32,7 @@ import java.util.List;
 /**
  * Tests queries with order by.
  */
-public class OrderByTest extends AbstractIndexingTest {
+public class OrderByTest extends AbstractQueryTest {
 
     public void testOrderByScore() throws RepositoryException {
         Node n1 = testRootNode.addNode("node1");
@@ -50,12 +50,12 @@ public class OrderByTest extends Abstrac
 
         String sql = "SELECT value FROM nt:unstructured WHERE " +
                 "jcr:path LIKE '" + testRoot + "/%' ORDER BY jcr:score, value";
-        Query q = session.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
+        Query q = qm.createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
         checkResult(result, 3);
 
         String xpath = "/" + testRoot + "/*[@jcr:primaryType='nt:unstructured'] order by
jcr:score(), @value";
-        q = session.getWorkspace().getQueryManager().createQuery(xpath, Query.XPATH);
+        q = qm.createQuery(xpath, Query.XPATH);
         result = q.execute();
         checkResult(result, 3);
     }
@@ -104,7 +104,7 @@ public class OrderByTest extends Abstrac
         testRootNode.save();
 
         String xpath = "/" + testRoot + "/*[@jcr:primaryType='nt:unstructured'] order by
fn:upper-case(@text)";
-        Query q = session.getWorkspace().getQueryManager().createQuery(xpath, Query.XPATH);
+        Query q = qm.createQuery(xpath, Query.XPATH);
         QueryResult result = q.execute();
         checkResult(result, new Node[]{n1, n2, n3});
     }
@@ -121,7 +121,7 @@ public class OrderByTest extends Abstrac
         testRootNode.save();
 
         String xpath = "/" + testRoot + "/*[@jcr:primaryType='nt:unstructured'] order by
fn:lower-case(@text)";
-        Query q = session.getWorkspace().getQueryManager().createQuery(xpath, Query.XPATH);
+        Query q = qm.createQuery(xpath, Query.XPATH);
         QueryResult result = q.execute();
         checkResult(result, new Node[]{n1, n2, n3});
     }
@@ -213,31 +213,31 @@ public class OrderByTest extends Abstrac
     //------------------------------< helper >----------------------------------
 
     private Value getValue(String value) throws RepositoryException {
-        return session.getValueFactory().createValue(value);
+        return superuser.getValueFactory().createValue(value);
     }
 
     private Value getValue(long value) throws RepositoryException {
-        return session.getValueFactory().createValue(value);
+        return superuser.getValueFactory().createValue(value);
     }
 
     private Value getValue(double value) throws RepositoryException {
-        return session.getValueFactory().createValue(value);
+        return superuser.getValueFactory().createValue(value);
     }
 
     private Value getValue(boolean value) throws RepositoryException {
-        return session.getValueFactory().createValue(value);
+        return superuser.getValueFactory().createValue(value);
     }
 
     private Value getValue(Calendar value) throws RepositoryException {
-        return session.getValueFactory().createValue(value);
+        return superuser.getValueFactory().createValue(value);
     }
 
     private Value getNameValue(String value) throws RepositoryException {
-        return session.getValueFactory().createValue(value, PropertyType.NAME);
+        return superuser.getValueFactory().createValue(value, PropertyType.NAME);
     }
 
     private Value getPathValue(String value) throws RepositoryException {
-        return session.getValueFactory().createValue(value, PropertyType.PATH);
+        return superuser.getValueFactory().createValue(value, PropertyType.PATH);
     }
 
     /**
@@ -251,7 +251,7 @@ public class OrderByTest extends Abstrac
         // child/prop is part of the test indexing configuration,
         // this will use SimpleScoreDocComparator internally
         checkChildAxis(values, "child", "property");
-        cleanUpTestRoot(session);
+        cleanUpTestRoot(superuser);
         // c/p is not in the indexing configuration,
         // this will use RelPathScoreDocComparator internally
         checkChildAxis(values, "c", "p");



Mime
View raw message