jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r1360835 - in /jackrabbit/trunk: jackrabbit-core/pom.xml jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/ShareableNodeTest.java
Date Thu, 12 Jul 2012 18:03:05 GMT
Author: reschke
Date: Thu Jul 12 18:03:05 2012
New Revision: 1360835

URL: http://svn.apache.org/viewvc?rev=1360835&view=rev
Log:
JCR-3380: TCK tests for shareable nodes assume moving shareable nodes is not supported

Modified:
    jackrabbit/trunk/jackrabbit-core/pom.xml
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/ShareableNodeTest.java

Modified: jackrabbit/trunk/jackrabbit-core/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/pom.xml?rev=1360835&r1=1360834&r2=1360835&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/pom.xml (original)
+++ jackrabbit/trunk/jackrabbit-core/pom.xml Thu Jul 12 18:03:05 2012
@@ -106,6 +106,8 @@ org.apache.jackrabbit.test.api.Shareable
 org.apache.jackrabbit.test.api.ShareableNodeTest#testGetNode
 org.apache.jackrabbit.test.api.ShareableNodeTest#testGetNodes
 org.apache.jackrabbit.test.api.ShareableNodeTest#testGetNodesByPattern
+org.apache.jackrabbit.test.api.ShareableNodeTest#testMoveShareableNode<!--JCR-3381-->
+org.apache.jackrabbit.test.api.ShareableNodeTest#testTransientMoveShareableNode<!--JCR-3381-->
 org.apache.jackrabbit.test.api.lock.OpenScopedLockTest#testLockExpiration
 org.apache.jackrabbit.test.api.lock.SessionScopedLockTest#testLockExpiration
 org.apache.jackrabbit.test.api.observation.NodeReorderTest#testNodeReorderMove

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/ShareableNodeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/ShareableNodeTest.java?rev=1360835&r1=1360834&r2=1360835&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/ShareableNodeTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/ShareableNodeTest.java
Thu Jul 12 18:03:05 2012
@@ -1218,10 +1218,10 @@ public class ShareableNodeTest extends A
     }
 
     /**
-     * Move a node in a shared set. This is unsupported in Jackrabbit.
+     * Move a node in a shared set.
      */
     public void testMoveShareableNode() throws Exception {
-        // setup parent nodes and first childs
+        // setup parent nodes and first children
         Node a1 = testRootNode.addNode("a1");
         Node a2 = testRootNode.addNode("a2");
         Node b = a1.addNode("b");
@@ -1229,26 +1229,24 @@ public class ShareableNodeTest extends A
 
         // add mixin
         ensureMixinType(b, mixShareable);
-        b.save();
+        b.getSession().save();
 
         // move
         Workspace workspace = b.getSession().getWorkspace();
 
-        try {
-            // move shareable node
-            workspace.move(b.getPath(), a2.getPath() + "/b");
-            fail("Moving a mix:shareable should fail.");
-        } catch (UnsupportedRepositoryOperationException e) {
-            // expected
-        }
+        // move shareable node
+        String newPath = a2.getPath() + "/b";
+        workspace.move(b.getPath(), newPath);
+        // move was performed using the workspace, so refresh the session
+        b.getSession().refresh(false);
+        assertEquals(newPath, b.getPath());
     }
 
     /**
-     * Transiently move a node in a shared set. This is unsupported in
-     * Jackrabbit.
+     * Transiently move a node in a shared set.
      */
     public void testTransientMoveShareableNode() throws Exception {
-        // setup parent nodes and first childs
+        // setup parent nodes and first children
         Node a1 = testRootNode.addNode("a1");
         Node a2 = testRootNode.addNode("a2");
         Node b = a1.addNode("b");
@@ -1256,19 +1254,16 @@ public class ShareableNodeTest extends A
 
         // add mixin
         ensureMixinType(b, mixShareable);
-        b.save();
+        b.getSession().save();
 
         // move
         Session session = superuser;
 
-        try {
-            // move shareable node
-            session.move(b.getPath(), a2.getPath() + "/b");
-            session.save();
-            fail("Moving a mix:shareable should fail.");
-        } catch (UnsupportedRepositoryOperationException e) {
-            // expected
-        }
+        // move shareable node
+        String newPath = a2.getPath() + "/b";
+        session.move(b.getPath(), newPath);
+        session.save();
+        assertEquals(newPath, b.getPath());
     }
 
     //----------------------------------------------------- implementation tests



Mime
View raw message