jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1441471 - in /jackrabbit/oak/trunk/oak-jcr: pom.xml src/test/java/org/apache/jackrabbit/oak/jcr/version/ src/test/java/org/apache/jackrabbit/oak/jcr/version/VersionHistoryTest.java
Date Fri, 01 Feb 2013 14:56:38 GMT
Author: angela
Date: Fri Feb  1 14:56:37 2013
New Revision: 1441471

URL: http://svn.apache.org/viewvc?rev=1441471&view=rev
Log:
OAK-168 Basic JCR VersionManager support (tests for OAK-601 and OAK-602)

Added:
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/version/
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/version/VersionHistoryTest.java
Modified:
    jackrabbit/oak/trunk/oak-jcr/pom.xml

Modified: jackrabbit/oak/trunk/oak-jcr/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/pom.xml?rev=1441471&r1=1441470&r2=1441471&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/pom.xml (original)
+++ jackrabbit/oak/trunk/oak-jcr/pom.xml Fri Feb  1 14:56:37 2013
@@ -17,7 +17,9 @@
    limitations under the License.
   -->
 
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd
">
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd
">
   <modelVersion>4.0.0</modelVersion>
 
   <parent>
@@ -235,6 +237,9 @@
       org.apache.jackrabbit.oak.jcr.security.user.GroupTest#testInheritedMembers        
                <!-- OAK-343 -->
       org.apache.jackrabbit.oak.jcr.security.user.GroupTest#testCyclicGroups            
                <!-- OAK-343 -->
       org.apache.jackrabbit.oak.jcr.security.user.AuthorizableTest#testRemoveListedAuthorizable
         <!-- OAK-343 -->
+      org.apache.jackrabbit.oak.jcr.version.VersionHistoryTest#testGetVersionHistoryFromNode
            <!-- OAK-601 -->
+      org.apache.jackrabbit.oak.jcr.version.VersionHistoryTest#testGetVersionHistory    
                <!-- OAK-602 -->
+      org.apache.jackrabbit.oak.jcr.version.VersionHistoryTest#testGetVersionHistoryAfterMove
           <!-- OAK-602 -->
     </known.issues>
   </properties>
 
@@ -261,7 +266,7 @@
           <groupId>org.apache.rat</groupId>
           <artifactId>apache-rat-plugin</artifactId>
           <configuration>
-            <excludes />
+            <excludes/>
           </configuration>
         </plugin>
       </plugins>
@@ -309,9 +314,9 @@
     </dependency>
 
     <dependency>
-        <groupId>com.google.guava</groupId>
-        <artifactId>guava</artifactId>
-        <version>${guava.version}</version>
+      <groupId>com.google.guava</groupId>
+      <artifactId>guava</artifactId>
+      <version>${guava.version}</version>
     </dependency>
     <dependency>
       <groupId>org.slf4j</groupId>
@@ -340,16 +345,16 @@
       <scope>test</scope>
     </dependency>
     <dependency>
-        <groupId>ch.qos.logback</groupId>
-        <artifactId>logback-classic</artifactId>
-        <version>1.0.1</version>
-        <scope>test</scope>
+      <groupId>ch.qos.logback</groupId>
+      <artifactId>logback-classic</artifactId>
+      <version>1.0.1</version>
+      <scope>test</scope>
     </dependency>
     <dependency>
-        <groupId>com.h2database</groupId>
-        <artifactId>h2</artifactId>
-        <version>1.3.158</version>
-        <scope>test</scope>
+      <groupId>com.h2database</groupId>
+      <artifactId>h2</artifactId>
+      <version>1.3.158</version>
+      <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>org.apache.jackrabbit</groupId>

Added: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/version/VersionHistoryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/version/VersionHistoryTest.java?rev=1441471&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/version/VersionHistoryTest.java
(added)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/version/VersionHistoryTest.java
Fri Feb  1 14:56:37 2013
@@ -0,0 +1,105 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.oak.jcr.version;
+
+import javax.jcr.Node;
+import javax.jcr.Session;
+import javax.jcr.version.VersionHistory;
+import javax.jcr.version.VersionManager;
+
+import org.apache.jackrabbit.JcrConstants;
+import org.apache.jackrabbit.test.AbstractJCRTest;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * VersionHistoryTest... TODO
+ */
+public class VersionHistoryTest extends AbstractJCRTest {
+
+    private VersionManager versionManager;
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+
+        versionManager = superuser.getWorkspace().getVersionManager();
+    }
+
+    @Test
+    public void testJcrVersionHistoryProperty() throws Exception {
+        testRootNode.addMixin(JcrConstants.MIX_VERSIONABLE);
+        superuser.save();
+
+        assertTrue(testRootNode.hasProperty(JcrConstants.JCR_VERSIONHISTORY));
+    }
+
+    @Ignore("OAK-601")
+    @Test
+    public void testGetVersionHistoryFromNode() throws Exception {
+        testRootNode.addMixin(JcrConstants.MIX_VERSIONABLE);
+        superuser.save();
+
+        VersionHistory vh = testRootNode.getVersionHistory();
+    }
+
+    @Ignore("OAK-602")
+    @Test
+    public void testGetVersionHistory() throws Exception {
+        testRootNode.addMixin(JcrConstants.MIX_VERSIONABLE);
+        superuser.save();
+
+        VersionHistory vh = versionManager.getVersionHistory(testRoot);
+    }
+
+    @Test
+    public void testGetVersionHistory2() throws Exception {
+        testRootNode.addMixin(JcrConstants.MIX_VERSIONABLE);
+        superuser.save();
+
+        Session s = getHelper().getSuperuserSession();
+        try {
+            VersionHistory vh = s.getWorkspace().getVersionManager().getVersionHistory(testRoot);
+        } finally {
+            s.logout();
+        }
+    }
+
+    @Test
+    public void testGetVersionHistoryNodeByUUID() throws Exception {
+        testRootNode.addMixin(JcrConstants.MIX_VERSIONABLE);
+        superuser.save();
+
+        Node vh = superuser.getNodeByUUID(testRootNode.getProperty(JcrConstants.JCR_VERSIONHISTORY).getString());
+    }
+
+    @Ignore("OAK-602")
+    @Test
+    public void testGetVersionHistoryAfterMove() throws Exception {
+        Node node1 = testRootNode.addNode(nodeName1);
+        node1.addMixin(JcrConstants.MIX_VERSIONABLE);
+        superuser.save();
+
+        Node node2 = testRootNode.addNode(nodeName2);
+        String destPath = node2.getPath() + "/" + nodeName3;
+        superuser.move(node1.getPath(), destPath);
+        superuser.save();
+
+        assertTrue(superuser.nodeExists(destPath));
+        VersionHistory vh = versionManager.getVersionHistory(destPath);
+    }
+}
\ No newline at end of file



Mime
View raw message