You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by re...@apache.org on 2007/08/17 16:00:42 UTC

svn commit: r567054 - in /jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api: WorkspaceCopyVersionableTest.java WorkspaceMoveVersionableTest.java

Author: reschke
Date: Fri Aug 17 07:00:41 2007
New Revision: 567054

URL: http://svn.apache.org/viewvc?view=rev&rev=567054
Log:
JCR-1065: let tests fails with NotExecutableException when the parent can not be made versionable

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

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/WorkspaceCopyVersionableTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/WorkspaceCopyVersionableTest.java?view=diff&rev=567054&r1=567053&r2=567054
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/WorkspaceCopyVersionableTest.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/WorkspaceCopyVersionableTest.java Fri Aug 17 07:00:41 2007
@@ -19,6 +19,7 @@
 import org.apache.jackrabbit.test.NotExecutableException;
 
 import javax.jcr.RepositoryException;
+import javax.jcr.nodetype.ConstraintViolationException;
 import javax.jcr.version.VersionException;
 
 
@@ -46,16 +47,21 @@
      * versionable and checked-in, or is non-versionable but its nearest
      * versionable ancestor is checked-in.
      */
-    public void testCopyNodesVersionableAndCheckedIn() throws RepositoryException {
+    public void testCopyNodesVersionableAndCheckedIn() throws RepositoryException, NotExecutableException {
         // prepare the test data
         // create a non-versionable node below a versionable node
         // required for having a nearest versionable ancestor to a nonversionable sub node
         String dstAbsPath = node1.getPath() + "/" + node2.getName();
         workspace.copy(node2.getPath(), dstAbsPath);
 
-        // make parent node versionable and check-in
-        addMixinVersionableToNode(testRootNode, node1);
-        node1.checkin();
+        try {
+            // make parent node versionable and check-in
+            addMixinVersionableToNode(testRootNode, node1);
+            node1.checkin();
+        }
+        catch (ConstraintViolationException ex) {
+            throw new NotExecutableException("server does not support making the parent versionable: " + ex.getMessage());
+        }
 
         // 1. parent node of destAbsPath is non-versionable but its nearest versionable ancestor is checked-in
         try {

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/WorkspaceMoveVersionableTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/WorkspaceMoveVersionableTest.java?view=diff&rev=567054&r1=567053&r2=567054
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/WorkspaceMoveVersionableTest.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/WorkspaceMoveVersionableTest.java Fri Aug 17 07:00:41 2007
@@ -19,6 +19,7 @@
 import org.apache.jackrabbit.test.NotExecutableException;
 
 import javax.jcr.RepositoryException;
+import javax.jcr.nodetype.ConstraintViolationException;
 import javax.jcr.version.VersionException;
 
 
@@ -46,16 +47,21 @@
      * versionable and checked-in, or is non-versionable but its nearest
      * versionable ancestor is checked-in.
      */
-    public void testMoveNodesVersionableAndCheckedIn() throws RepositoryException {
+    public void testMoveNodesVersionableAndCheckedIn() throws RepositoryException, NotExecutableException {
         // prepare the test data
         // create a non-versionable node below a versionable node
         // required for having a nearest versionable ancestor to a nonversionable sub node
         String dstAbsPath = node1.getPath() + "/" + node2.getName();
         workspace.copy(node2.getPath(), dstAbsPath);
 
-        // make parent node versionable and check-in
-        addMixinVersionableToNode(testRootNode, node1);
-        node1.checkin();
+        try {
+            // make parent node versionable and check-in
+            addMixinVersionableToNode(testRootNode, node1);
+            node1.checkin();
+        }
+        catch (ConstraintViolationException ex) {
+            throw new NotExecutableException("server does not support making the parent versionable: " + ex.getMessage());
+        }
 
         // 1. parent node of destAbsPath is non-versionable but its nearest versionable ancestor is checked-in
         try {