jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tri...@apache.org
Subject svn commit: r423948 - in /jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test: AbstractJCRTest.java api/version/RemoveVersionTest.java api/version/VersionTest.java
Date Thu, 20 Jul 2006 14:45:02 GMT
Author: tripod
Date: Thu Jul 20 07:45:01 2006
New Revision: 423948

URL: http://svn.apache.org/viewvc?rev=423948&view=rev
Log:
Adding some testcases

Modified:
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/AbstractJCRTest.java
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/version/RemoveVersionTest.java
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/version/VersionTest.java

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/AbstractJCRTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/AbstractJCRTest.java?rev=423948&r1=423947&r2=423948&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/AbstractJCRTest.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/AbstractJCRTest.java
Thu Jul 20 07:45:01 2006
@@ -97,6 +97,11 @@
     protected String jcrFrozenNode;
 
     /**
+     * JCR Name jcr:frozenUuid using the namespace resolver of the current session.
+     */
+    protected String jcrFrozenUuid;
+
+    /**
      * JCR Name jcr:rootVersion using the namespace resolver of the current session.
      */
     protected String jcrRootVersion;
@@ -292,6 +297,7 @@
         jcrCreated = superuser.getNamespacePrefix(NS_JCR_URI) + ":created";
         jcrVersionHistory = superuser.getNamespacePrefix(NS_JCR_URI) + ":versionHistory";
         jcrFrozenNode = superuser.getNamespacePrefix(NS_JCR_URI) + ":frozenNode";
+        jcrFrozenUuid = superuser.getNamespacePrefix(NS_JCR_URI) + ":frozenUuid";
         jcrRootVersion = superuser.getNamespacePrefix(NS_JCR_URI) + ":rootVersion";
         jcrBaseVersion = superuser.getNamespacePrefix(NS_JCR_URI) + ":baseVersion";
         jcrUUID = superuser.getNamespacePrefix(NS_JCR_URI) + ":uuid";

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/version/RemoveVersionTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/version/RemoveVersionTest.java?rev=423948&r1=423947&r2=423948&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/version/RemoveVersionTest.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/version/RemoveVersionTest.java
Thu Jul 20 07:45:01 2006
@@ -17,6 +17,7 @@
 package org.apache.jackrabbit.test.api.version;
 
 import org.apache.jackrabbit.test.NotExecutableException;
+import org.apache.jackrabbit.core.UserTransactionImpl;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.UnsupportedRepositoryOperationException;
@@ -26,6 +27,7 @@
 import javax.jcr.version.VersionException;
 import javax.jcr.version.VersionHistory;
 import javax.jcr.version.VersionIterator;
+import javax.transaction.UserTransaction;
 import java.util.Arrays;
 import java.util.ArrayList;
 import java.util.List;
@@ -84,6 +86,20 @@
             versionableNode2.remove();
         } finally {
             super.tearDown();
+        }
+    }
+
+    /**
+     * Test removed version gets invalid
+     */
+    public void testRemovedInvalid() throws Exception {
+        versionableNode.getVersionHistory().removeVersion(version.getName());
+        // assert: version has become invalid
+        try {
+            version.getPredecessors();
+            fail("Removed version still operational.");
+        } catch (RepositoryException e) {
+            // expected
         }
     }
 

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/version/VersionTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/version/VersionTest.java?rev=423948&r1=423947&r2=423948&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/version/VersionTest.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/version/VersionTest.java
Thu Jul 20 07:45:01 2006
@@ -708,4 +708,13 @@
         } catch (ConstraintViolationException success) {
         }
     }
+
+    /**
+     * Tests if the jcr:frozenUuid property has the correct type
+     * @throws Exception
+     */
+    public void testFrozenUUID() throws Exception {
+        Property p = version.getNode(jcrFrozenNode).getProperty(jcrFrozenUuid);
+        assertEquals("jcr:fronzenUuid should be of type string", PropertyType.TYPENAME_STRING,
PropertyType.nameFromValue(p.getType()));
+    }
 }



Mime
View raw message