jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r480932 - /jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/
Date Thu, 30 Nov 2006 14:11:51 GMT
Author: mreutegg
Date: Thu Nov 30 06:11:49 2006
New Revision: 480932

URL: http://svn.apache.org/viewvc?view=rev&rev=480932
Log:
JCR-653: Some Workspace tests require a second workspace

Modified:
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/AbstractWorkspaceCopyBetweenTest.java
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/ReferenceableRootNodesTest.java
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceCloneReferenceableTest.java
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceCopyReferenceableTest.java
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceCopySameNameSibsTest.java
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceCopyVersionableTest.java
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceMoveReferenceableTest.java
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceMoveSameNameSibsTest.java
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceMoveVersionableTest.java

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/AbstractWorkspaceCopyBetweenTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/AbstractWorkspaceCopyBetweenTest.java?view=diff&rev=480932&r1=480931&r2=480932
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/AbstractWorkspaceCopyBetweenTest.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/AbstractWorkspaceCopyBetweenTest.java
Thu Nov 30 06:11:49 2006
@@ -16,6 +16,8 @@
  */
 package org.apache.jackrabbit.test.api;
 
+import org.apache.jackrabbit.test.NotExecutableException;
+
 import javax.jcr.Node;
 import javax.jcr.NodeIterator;
 import javax.jcr.RepositoryException;
@@ -63,8 +65,9 @@
         super.setUp();
 
         // init second workspace
-        superuserW2 = helper.getSuperuserSession(workspaceName);
-        rwSessionW2 = helper.getReadWriteSession(workspaceName);
+        String otherWspName = getOtherWorkspaceName();
+        superuserW2 = helper.getSuperuserSession(otherWspName);
+        rwSessionW2 = helper.getReadWriteSession(otherWspName);
         workspaceW2 = superuserW2.getWorkspace();
 
         initNodesW2();
@@ -88,8 +91,14 @@
         super.tearDown();
     }
 
+    protected String getOtherWorkspaceName() throws NotExecutableException {
+        if (workspace.getName().equals(workspaceName)) {
+            throw new NotExecutableException("Cannot test copy between workspaces. 'workspaceName'
points to default workspace as well.");
+        }
+        return workspaceName;
+    }
 
-    private void initNodesW2() throws RepositoryException {
+    protected void initNodesW2() throws RepositoryException {
 
         // testroot
         if (superuserW2.getRootNode().hasNode(testPath)) {

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/ReferenceableRootNodesTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/ReferenceableRootNodesTest.java?view=diff&rev=480932&r1=480931&r2=480932
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/ReferenceableRootNodesTest.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/ReferenceableRootNodesTest.java
Thu Nov 30 06:11:49 2006
@@ -50,6 +50,12 @@
 
         session = helper.getReadOnlySession();
         sessionW2 = helper.getReadOnlySession(workspaceName);
+                
+        String wspName = session.getWorkspace().getName();
+        boolean sameWsp = (wspName == null) ? workspaceName == null : wspName.equals(workspaceName);
+        if (sameWsp) {
+            throw new NotExecutableException("Cannot compare uuid behaviour of different
workspaces. Only a single workspace configured.");
+        }
     }
 
     /**
@@ -90,4 +96,4 @@
             throw new NotExecutableException("Root node is not referenceable");
         }
     }
-}
\ No newline at end of file
+}

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceCloneReferenceableTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceCloneReferenceableTest.java?view=diff&rev=480932&r1=480931&r2=480932
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceCloneReferenceableTest.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceCloneReferenceableTest.java
Thu Nov 30 06:11:49 2006
@@ -16,6 +16,8 @@
  */
 package org.apache.jackrabbit.test.api;
 
+import org.apache.jackrabbit.test.NotExecutableException;
+
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 import javax.jcr.ItemExistsException;
@@ -122,4 +124,4 @@
         }
     }
 
-}
\ No newline at end of file
+}

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceCopyReferenceableTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceCopyReferenceableTest.java?view=diff&rev=480932&r1=480931&r2=480932
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceCopyReferenceableTest.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceCopyReferenceableTest.java
Thu Nov 30 06:11:49 2006
@@ -16,6 +16,8 @@
  */
 package org.apache.jackrabbit.test.api;
 
+import org.apache.jackrabbit.test.NotExecutableException;
+
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 
@@ -30,6 +32,14 @@
  */
 public class WorkspaceCopyReferenceableTest extends AbstractWorkspaceReferenceableTest {
 
+    protected String getOtherWorkspaceName() throws NotExecutableException {
+        return workspace.getName();
+    }
+
+    protected void initNodesW2() throws RepositoryException {
+        // nothing to do.
+    }
+
     /**
      * Copies of referenceable nodes (nodes with UUIDs) are automatically given
      * new UUIDs.
@@ -49,4 +59,4 @@
 
         assertFalse(originalUUID.equals(copiedUUID));
     }
-}
\ No newline at end of file
+}

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceCopySameNameSibsTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceCopySameNameSibsTest.java?view=diff&rev=480932&r1=480931&r2=480932
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceCopySameNameSibsTest.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceCopySameNameSibsTest.java
Thu Nov 30 06:11:49 2006
@@ -16,6 +16,8 @@
  */
 package org.apache.jackrabbit.test.api;
 
+import org.apache.jackrabbit.test.NotExecutableException;
+
 import javax.jcr.ItemExistsException;
 import javax.jcr.Node;
 import javax.jcr.NodeIterator;
@@ -32,6 +34,14 @@
  */
 public class WorkspaceCopySameNameSibsTest extends AbstractWorkspaceSameNameSibsTest {
 
+    protected String getOtherWorkspaceName() throws NotExecutableException {
+        return workspace.getName();
+    }
+
+    protected void initNodesW2() throws RepositoryException {
+        // nothing to do.
+    }
+
     /**
      * If ordering is supported by the node type of the parent node of the new
      * location, then the newly moved node is appended to the end of the child
@@ -82,4 +92,4 @@
             // successful
         }
     }
-}
\ No newline at end of file
+}

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceCopyVersionableTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceCopyVersionableTest.java?view=diff&rev=480932&r1=480931&r2=480932
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceCopyVersionableTest.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceCopyVersionableTest.java
Thu Nov 30 06:11:49 2006
@@ -16,6 +16,8 @@
  */
 package org.apache.jackrabbit.test.api;
 
+import org.apache.jackrabbit.test.NotExecutableException;
+
 import javax.jcr.RepositoryException;
 import javax.jcr.version.VersionException;
 
@@ -31,6 +33,14 @@
  */
 public class WorkspaceCopyVersionableTest extends AbstractWorkspaceVersionableTest {
 
+    protected String getOtherWorkspaceName() throws NotExecutableException {
+        return workspace.getName();
+    }
+
+    protected void initNodesW2() throws RepositoryException {
+        // nothing to do.
+    }
+
     /**
      * A VersionException is thrown if the parent node of destAbsPath is
      * versionable and checked-in, or is non-versionable but its nearest
@@ -64,4 +74,4 @@
         }
     }
 
-}
\ No newline at end of file
+}

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceMoveReferenceableTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceMoveReferenceableTest.java?view=diff&rev=480932&r1=480931&r2=480932
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceMoveReferenceableTest.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceMoveReferenceableTest.java
Thu Nov 30 06:11:49 2006
@@ -16,6 +16,8 @@
  */
 package org.apache.jackrabbit.test.api;
 
+import org.apache.jackrabbit.test.NotExecutableException;
+
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 
@@ -30,6 +32,14 @@
  */
 public class WorkspaceMoveReferenceableTest extends AbstractWorkspaceReferenceableTest {
 
+    protected String getOtherWorkspaceName() throws NotExecutableException {
+        return workspace.getName();
+    }
+
+    protected void initNodesW2() throws RepositoryException {
+        // nothing to do.
+    }
+    
     /**
      * Copies of referenceable nodes (nodes with UUIDs) remains their original
      * UUIDs.
@@ -49,4 +59,4 @@
 
         assertTrue(originalUUID.equals(movedUUID));
     }
-}
\ No newline at end of file
+}

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceMoveSameNameSibsTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceMoveSameNameSibsTest.java?view=diff&rev=480932&r1=480931&r2=480932
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceMoveSameNameSibsTest.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceMoveSameNameSibsTest.java
Thu Nov 30 06:11:49 2006
@@ -16,6 +16,8 @@
  */
 package org.apache.jackrabbit.test.api;
 
+import org.apache.jackrabbit.test.NotExecutableException;
+
 import javax.jcr.ItemExistsException;
 import javax.jcr.Node;
 import javax.jcr.NodeIterator;
@@ -32,6 +34,14 @@
  */
 public class WorkspaceMoveSameNameSibsTest extends AbstractWorkspaceSameNameSibsTest {
 
+    protected String getOtherWorkspaceName() throws NotExecutableException {
+        return workspace.getName();
+    }
+
+    protected void initNodesW2() throws RepositoryException {
+        // nothing to do.
+    }
+
     /**
      * If ordering is supported by the node type of the parent node of the new
      * location, then the newly moved node is appended to the end of the child
@@ -41,7 +51,7 @@
         // test assumes that repositry supports Orderable Child Node Support (optional)
         String[] orderList = {nodeName1, nodeName2, nodeName3};
 
-        // create a new node to move node three times
+        // create a new node to move nodes
         Node newNode = testRootNode.addNode(nodeName2, testNodeType);
         testRootNode.save();
 
@@ -86,4 +96,4 @@
             // successful
         }
     }
-}
\ No newline at end of file
+}

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceMoveVersionableTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceMoveVersionableTest.java?view=diff&rev=480932&r1=480931&r2=480932
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceMoveVersionableTest.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceMoveVersionableTest.java
Thu Nov 30 06:11:49 2006
@@ -16,6 +16,8 @@
  */
 package org.apache.jackrabbit.test.api;
 
+import org.apache.jackrabbit.test.NotExecutableException;
+
 import javax.jcr.RepositoryException;
 import javax.jcr.version.VersionException;
 
@@ -31,6 +33,14 @@
  */
 public class WorkspaceMoveVersionableTest extends AbstractWorkspaceVersionableTest {
 
+    protected String getOtherWorkspaceName() throws NotExecutableException {
+        return workspace.getName();
+    }
+
+    protected void initNodesW2() throws RepositoryException {
+        // nothing to do.
+    }
+    
     /**
      * A VersionException is thrown if the parent node of destAbsPath is
      * versionable and checked-in, or is non-versionable but its nearest
@@ -64,4 +74,4 @@
         }
     }
 
-}
\ No newline at end of file
+}



Mime
View raw message