You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by an...@apache.org on 2007/10/03 17:45:01 UTC

svn commit: r581637 - /jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/WorkspaceMoveTest.java

Author: angela
Date: Wed Oct  3 08:44:59 2007
New Revision: 581637

URL: http://svn.apache.org/viewvc?rev=581637&view=rev
Log:
Test: fix test for Workspace.move(). Transient modifications should not have an effect.

Modified:
    jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/WorkspaceMoveTest.java

Modified: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/WorkspaceMoveTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/WorkspaceMoveTest.java?rev=581637&r1=581636&r2=581637&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/WorkspaceMoveTest.java (original)
+++ jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/WorkspaceMoveTest.java Wed Oct  3 08:44:59 2007
@@ -66,7 +66,7 @@
         }
     }
 
-    public void testMoveTransientPropertyExistsException() throws RepositoryException, NotExecutableException {
+    public void testMoveTransientPropertyExists() throws RepositoryException, NotExecutableException {
         // try to create a property with the name of the node to be moved
         // to the destination parent
         Property destProperty;
@@ -76,12 +76,14 @@
             throw new NotExecutableException("Cannot create property with name '" +nodeName2+ "' and value 'anyString' at move destination.");
         }
 
+        // workspace-move the node (must succeed)
+        doMove(moveNode.getPath(), destProperty.getPath());
         try {
-            // move the node
-            doMove(moveNode.getPath(), destProperty.getPath());
-            fail("Moving a node to a location where a property exists must throw ItemExistsException");
-        } catch (ItemExistsException e) {
-            // ok, works as expected
+            // saving transient new property must fail
+            destParentNode.save();
+            fail("Saving new transient property must fail");
+        } catch (RepositoryException e) {
+            // ok.
         }
     }
 }