jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r1519992 - /jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/version/VersionTest.java
Date Wed, 04 Sep 2013 12:18:42 GMT
Author: mreutegg
Date: Wed Sep  4 12:18:42 2013
New Revision: 1519992

URL: http://svn.apache.org/r1519992
Log:
OAK-996: Incorrect types for version result nodes
- Add test case

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/version/VersionTest.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/version/VersionTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/version/VersionTest.java?rev=1519992&r1=1519991&r2=1519992&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/version/VersionTest.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/version/VersionTest.java
Wed Sep  4 12:18:42 2013
@@ -17,11 +17,16 @@
 package org.apache.jackrabbit.oak.jcr.version;
 
 import javax.jcr.Node;
+import javax.jcr.NodeIterator;
 import javax.jcr.RepositoryException;
+import javax.jcr.query.Query;
+import javax.jcr.query.QueryManager;
+import javax.jcr.query.RowIterator;
 import javax.jcr.version.Version;
 import javax.jcr.version.VersionManager;
 
 import org.apache.jackrabbit.test.AbstractJCRTest;
+import org.apache.jackrabbit.test.NotExecutableException;
 
 /**
  * <code>VersionTest</code> performs tests on JCR Version nodes.
@@ -48,4 +53,26 @@ public class VersionTest extends Abstrac
         assertTrue("Session.getNodeByUUID() did not return Version object for a nt:version
node.",
                 superuser.getNodeByUUID(uuid) instanceof Version);
     }
+
+    public void testVersionFromQuery()
+            throws RepositoryException, NotExecutableException {
+        if (true) {
+            throw new NotExecutableException("OAK-996");
+        }
+        Node n = testRootNode.addNode(nodeName1, testNodeType);
+        n.addMixin(mixVersionable);
+        superuser.save();
+        VersionManager vMgr = superuser.getWorkspace().getVersionManager();
+        vMgr.checkpoint(n.getPath());
+        QueryManager qm = superuser.getWorkspace().getQueryManager();
+        Version v = vMgr.getBaseVersion(n.getPath());
+        Query q = qm.createQuery("//element(*, nt:version)[@jcr:uuid = '" +
+                v.getIdentifier() + "']", Query.XPATH);
+        NodeIterator nodes = q.execute().getNodes();
+        assertTrue(nodes.hasNext());
+        assertTrue(nodes.nextNode() instanceof Version);
+        RowIterator rows = q.execute().getRows();
+        assertTrue(rows.hasNext());
+        assertTrue(rows.nextRow().getNode() instanceof Version);
+    }
 }



Mime
View raw message