jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r614177 - /jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/QueryResultNodeIteratorTest.java
Date Tue, 22 Jan 2008 11:21:54 GMT
Author: reschke
Date: Tue Jan 22 03:21:52 2008
New Revision: 614177

URL: http://svn.apache.org/viewvc?rev=614177&view=rev
Log:
JCR-1335: re-execute the query instead of re-acquiring the result set iterator

Modified:
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/QueryResultNodeIteratorTest.java

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/QueryResultNodeIteratorTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/QueryResultNodeIteratorTest.java?rev=614177&r1=614176&r2=614177&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/QueryResultNodeIteratorTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/QueryResultNodeIteratorTest.java
Tue Jan 22 03:21:52 2008
@@ -121,7 +121,8 @@
      * Tests if {@link javax.jcr.NodeIterator#skip(long)} works correctly.
      */
     public void testSkip() throws RepositoryException {
-        QueryResult rs = execute(testPath + "//*", Query.XPATH);
+        String query = testPath + "//*";
+        QueryResult rs = execute(query, Query.XPATH);
         NodeIterator it = rs.getNodes();
 
         // find out if there is anything we can skip
@@ -131,7 +132,8 @@
             count++;
         }
         if (count > 1) {
-            // re-aquire iterator
+            // re-execute the query
+            rs = execute(query, Query.XPATH);
             it = rs.getNodes();
             // skip all but one
             it.skip(count - 1);
@@ -144,7 +146,8 @@
                 // success
             }
 
-            // re-aquire iterator
+            // re-execute the query
+            rs = execute(query, Query.XPATH);
             it = rs.getNodes();
             try {
                 it.skip(count + 1);



Mime
View raw message