jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1444037 - /jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java
Date Fri, 08 Feb 2013 14:58:18 GMT
Author: mduerig
Date: Fri Feb  8 14:58:18 2013
New Revision: 1444037

URL: http://svn.apache.org/r1444037
Log:
OAK-617: Generalise Tree.Status.REMOVED to DISCONNECTED
test case

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java?rev=1444037&r1=1444036&r2=1444037&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java
Fri Feb  8 14:58:18 2013
@@ -1621,6 +1621,30 @@ public class RepositoryTest extends Abst
     }
 
     @Test
+    public void invalidItemStateExceptionOnRemovedNode() throws Exception {
+        Session session = getAdminSession();
+
+        for (String parentPath : new String[] {"/", TEST_PATH}) {
+            Node parent = session.getNode(parentPath);
+            Node child = parent.addNode("child");
+
+            child.remove();
+            try {
+                child.getPath();
+                fail();
+            }
+            catch (InvalidItemStateException expected) { }
+
+            session.save();
+            try {
+                child.getPath();
+                fail();
+            }
+            catch (InvalidItemStateException expected) { }
+        }
+    }
+
+    @Test
     public void setPrimaryType() throws RepositoryException {
         Node testNode = getNode(TEST_PATH);
         assertEquals("nt:unstructured", testNode.getPrimaryNodeType().getName());



Mime
View raw message