jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1584781 - in /jackrabbit/oak/trunk: oak-core/src/test/java/org/apache/jackrabbit/oak/core/MutableTreeTest.java oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java
Date Fri, 04 Apr 2014 16:11:41 GMT
Author: mduerig
Date: Fri Apr  4 16:11:40 2014
New Revision: 1584781

URL: http://svn.apache.org/r1584781
Log:
OAK-1674: Node isNew() is false in case the node is removed and added in same commit
@Ignored test cases

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

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/MutableTreeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/MutableTreeTest.java?rev=1584781&r1=1584780&r2=1584781&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/MutableTreeTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/MutableTreeTest.java
Fri Apr  4 16:11:40 2014
@@ -45,6 +45,7 @@ import org.apache.jackrabbit.oak.plugins
 import org.apache.jackrabbit.oak.plugins.tree.TreeConstants;
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 
 /**
@@ -312,6 +313,18 @@ public class MutableTreeTest extends Oak
         assertFalse(y.exists());
     }
 
+    @Ignore("OAK-1674")  // FIXME OAK-1674
+    @Test
+    public void isNew() throws CommitFailedException {
+        Tree tree = root.getTree("/");
+        tree.addChild("c");
+        root.commit();
+
+        tree.getChild("c").remove();
+        Tree c = tree.addChild("c");
+        assertEquals(Status.NEW, c.getStatus());
+    }
+
     @Test
     public void modifiedAfterRebase() throws CommitFailedException {
         Tree tree = root.getTree("/");

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=1584781&r1=1584780&r2=1584781&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 Apr  4 16:11:40 2014
@@ -18,6 +18,15 @@
  */
 package org.apache.jackrabbit.oak.jcr;
 
+import static java.util.Arrays.asList;
+import static org.apache.jackrabbit.commons.JcrUtils.getChildNodes;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.junit.Assume.assumeTrue;
+
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
@@ -29,6 +38,7 @@ import java.util.Calendar;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.Set;
+
 import javax.jcr.Binary;
 import javax.jcr.GuestCredentials;
 import javax.jcr.ImportUUIDBehavior;
@@ -69,15 +79,6 @@ import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.Test;
 
-import static java.util.Arrays.asList;
-import static org.apache.jackrabbit.commons.JcrUtils.getChildNodes;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.junit.Assume.assumeTrue;
-
 public class RepositoryTest extends AbstractRepositoryTest {
     private static final String TEST_NODE = "test_node";
     private static final String TEST_PATH = '/' + TEST_NODE;
@@ -566,6 +567,21 @@ public class RepositoryTest extends Abst
         }
     }
 
+    @Ignore("OAK-1674")  // FIXME OAK-1674
+    @Test
+    public void testIsNew() throws RepositoryException, InterruptedException {
+        Session session = getAdminSession();
+        Node root = session.getRootNode();
+        Node node1 = root.addNode("node1");
+        session.save();
+
+        node1.remove();
+        Node node2 = root.addNode("node2");
+        assertTrue("The Node is just added", node2.isNew());
+        Node node1Again = root.addNode("node1");
+        assertTrue("The Node is just added but has a remove in same commit", node1Again.isNew());
+    }
+
     @Test
     public void testAddNodeWithExpandedName() throws RepositoryException {
         Session session = getAdminSession();



Mime
View raw message