jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexparvule...@apache.org
Subject svn commit: r1387910 - /jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/LimitAndOffsetTest.java
Date Thu, 20 Sep 2012 08:48:36 GMT
Author: alexparvulescu
Date: Thu Sep 20 08:48:36 2012
New Revision: 1387910

URL: http://svn.apache.org/viewvc?rev=1387910&view=rev
Log:
JCR-3429 Make query tests (more) independent
 - removed use of SNS

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

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/LimitAndOffsetTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/LimitAndOffsetTest.java?rev=1387910&r1=1387909&r2=1387910&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/LimitAndOffsetTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/LimitAndOffsetTest.java
Thu Sep 20 08:48:36 2012
@@ -19,9 +19,7 @@ package org.apache.jackrabbit.core.query
 import javax.jcr.Node;
 import javax.jcr.NodeIterator;
 import javax.jcr.RepositoryException;
-import javax.jcr.query.InvalidQueryException;
 import javax.jcr.query.Query;
-import javax.jcr.query.QueryManager;
 import javax.jcr.query.QueryResult;
 
 import org.apache.jackrabbit.core.query.lucene.QueryResultImpl;
@@ -39,14 +37,15 @@ public class LimitAndOffsetTest extends 
 
         node1 = testRootNode.addNode("foo");
         node1.setProperty("name", "1");
-        node2 = testRootNode.addNode("foo");
+        node2 = testRootNode.addNode("bar");
         node2.setProperty("name", "2");
-        node3 = testRootNode.addNode("foo");
+        node3 = testRootNode.addNode("baz");
         node3.setProperty("name", "3");
 
-        testRootNode.save();
+        testRootNode.getSession().save();
 
-        query = createXPathQuery("/jcr:root" + testRoot + "/* order by @name");
+        query = qm.createQuery("/jcr:root" + testRoot + "/* order by @name",
+                Query.XPATH);
     }
 
     protected void tearDown() throws Exception {
@@ -57,12 +56,6 @@ public class LimitAndOffsetTest extends 
         super.tearDown();
     }
 
-    private Query createXPathQuery(String xpath)
-            throws InvalidQueryException, RepositoryException {
-        QueryManager queryManager = superuser.getWorkspace().getQueryManager();
-        return queryManager.createQuery(xpath, Query.XPATH);
-    }
-
     protected void checkResult(QueryResult result, Node[] expectedNodes) throws RepositoryException
{
         assertEquals(expectedNodes.length, result.getNodes().getSize());
     }



Mime
View raw message