jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1471354 - /jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilderTest.java
Date Wed, 24 Apr 2013 10:35:50 GMT
Author: mduerig
Date: Wed Apr 24 10:35:49 2013
New Revision: 1471354

URL: http://svn.apache.org/r1471354
Log:
OAK-781: Clarify / fix effects of MISSING_NODE as base state of NodeBuilder
 test cases

Modified:
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilderTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilderTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilderTest.java?rev=1471354&r1=1471353&r2=1471354&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilderTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilderTest.java
Wed Apr 24 10:35:49 2013
@@ -199,6 +199,59 @@ public class MemoryNodeBuilderTest {
 
     @Test
     @Ignore("OAK-781")
+    public void testExistingStatus() {
+        NodeBuilder root = base.builder();
+        NodeBuilder x = root.child("x");
+        assertTrue(x.isConnected());
+        assertTrue(x.exists());
+        assertFalse(x.isNew());
+        assertFalse(x.isModified());
+    }
+
+    @Test
+    public void testModifiedStatus() {
+        NodeBuilder root = base.builder();
+        NodeBuilder x = root.child("x");
+        x.setProperty("p", "pValue");
+        assertTrue(x.isConnected());
+        assertTrue(x.exists());
+        assertFalse(x.isNew());
+        assertTrue(x.isModified());
+    }
+
+    @Test
+    @Ignore("OAK-781")
+    public void testRemovedStatus() {
+        NodeBuilder root = base.builder();
+        NodeBuilder x = root.child("x");
+        root.removeNode("x");
+        assertFalse(x.isConnected());
+        try {
+            assertTrue(x.exists());
+            fail();
+        } catch (IllegalStateException expected) {}
+        try {
+            assertFalse(x.isNew());
+            fail();
+        } catch (IllegalStateException expected) {}
+        try {
+            assertFalse(x.isModified());
+            fail();
+        } catch (IllegalStateException expected) {}
+    }
+
+    @Test
+    public void testNewStatus() {
+        NodeBuilder root = base.builder();
+        NodeBuilder n = root.child("n");
+        assertTrue(n.isConnected());
+        assertTrue(n.exists());
+        assertTrue(n.isNew());
+        assertFalse(n.isModified());
+    }
+
+    @Test
+    @Ignore("OAK-781")
     public void getExistingChildTest() {
         NodeBuilder rootBuilder = base.builder();
         NodeBuilder x = rootBuilder.getChild("x");



Mime
View raw message