jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cki...@apache.org
Subject svn commit: r566039 - in /jackrabbit/trunk: jackrabbit-api/src/main/java/org/apache/jackrabbit/api/ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/ jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/
Date Wed, 15 Aug 2007 06:46:09 GMT
Author: ckiehl
Date: Tue Aug 14 23:46:08 2007
New Revision: 566039

URL: http://svn.apache.org/viewvc?view=rev&rev=566039
Log:
JCR-989: Removed JackrabbitQuery interface from API as discussed

Removed:
    jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/JackrabbitQuery.java
Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/AbstractQueryImpl.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/LimitAndOffsetTest.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/AbstractQueryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/AbstractQueryImpl.java?view=diff&rev=566039&r1=566038&r2=566039
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/AbstractQueryImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/AbstractQueryImpl.java
Tue Aug 14 23:46:08 2007
@@ -16,18 +16,18 @@
  */
 package org.apache.jackrabbit.core.query;
 
-import org.apache.jackrabbit.api.JackrabbitQuery;
-import org.apache.jackrabbit.core.SessionImpl;
-import org.apache.jackrabbit.core.ItemManager;
-
-import javax.jcr.query.InvalidQueryException;
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
+import javax.jcr.query.InvalidQueryException;
+import javax.jcr.query.Query;
+
+import org.apache.jackrabbit.core.ItemManager;
+import org.apache.jackrabbit.core.SessionImpl;
 
 /**
  * Defines common initialization methods for all query implementations.
  */
-public abstract class AbstractQueryImpl implements JackrabbitQuery {
+public abstract class AbstractQueryImpl implements Query {
 
     /**
      * Initializes a query instance from a query string.

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?view=diff&rev=566039&r1=566038&r2=566039
==============================================================================
--- 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
Tue Aug 14 23:46:08 2007
@@ -1,21 +1,20 @@
 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.api.JackrabbitQuery;
-
 public class LimitAndOffsetTest extends AbstractQueryTest {
 
     private Node node1;
     private Node node2;
     private Node node3;
 
-    private JackrabbitQuery query;
+    private QueryImpl query;
 
     protected void setUp() throws Exception {
         super.setUp();
@@ -32,10 +31,10 @@
         query = createXPathQuery("/jcr:root" + testRoot + "/* order by @name");
     }
 
-    private JackrabbitQuery createXPathQuery(String xpath)
+    private QueryImpl createXPathQuery(String xpath)
             throws InvalidQueryException, RepositoryException {
         QueryManager queryManager = superuser.getWorkspace().getQueryManager();
-        return (JackrabbitQuery) queryManager.createQuery(xpath, Query.XPATH);
+        return (QueryImpl) queryManager.createQuery(xpath, Query.XPATH);
     }
 
     public void testLimit() throws Exception {
@@ -86,6 +85,14 @@
         query.setLimit(2);
         result = query.execute();
         checkResult(result, new Node[] { node1, node2 });
+    }
+
+    public void testOffsetAndSkip() throws Exception {
+        query.setOffset(1);
+        QueryResult result = query.execute();
+        NodeIterator nodes = result.getNodes();
+        nodes.skip(1);
+        assertTrue(nodes.nextNode() == node3);
     }
 
 }



Mime
View raw message