jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From meteata...@apache.org
Subject svn commit: r1421808 - in /jackrabbit/oak/trunk/oak-mongomk/src: main/java/org/apache/jackrabbit/mongomk/impl/instruction/CommitCommandInstructionVisitor.java test/java/org/apache/jackrabbit/mongomk/impl/MongoMKCommitRemoveTest.java
Date Fri, 14 Dec 2012 12:10:03 GMT
Author: meteatamel
Date: Fri Dec 14 12:10:01 2012
New Revision: 1421808

URL: http://svn.apache.org/viewvc?rev=1421808&view=rev
Log:
OAK-507 - MicroKernel.commit() throws NotFoundException for an existing node

Allow the non-existent node delete case in MongoMK

Modified:
    jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/instruction/CommitCommandInstructionVisitor.java
    jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKCommitRemoveTest.java

Modified: jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/instruction/CommitCommandInstructionVisitor.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/instruction/CommitCommandInstructionVisitor.java?rev=1421808&r1=1421807&r2=1421808&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/instruction/CommitCommandInstructionVisitor.java
(original)
+++ jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/instruction/CommitCommandInstructionVisitor.java
Fri Dec 14 12:10:01 2012
@@ -123,13 +123,15 @@ public class CommitCommandInstructionVis
         checkAbsolutePath(nodePath);
 
         String parentPath = PathUtils.getParentPath(nodePath);
+        MongoNode parent = getStagedNode(parentPath);
         String nodeName = PathUtils.getName(nodePath);
-        MongoNode parent = getStoredNode(parentPath);
-        if (!parent.childExists(nodeName)) {
-            throw new RuntimeException("Node " + nodeName
-                    + " does not exists at parent path: " + parentPath);
-        }
-        parent.removeChild(PathUtils.getName(nodePath));
+        // See OAK-507
+//        MongoNode parent = getStoredNode(parentPath);
+//        if (!parent.childExists(nodeName)) {
+//            throw new RuntimeException("Node " + nodeName
+//                    + " does not exists at parent path: " + parentPath);
+//        }
+        parent.removeChild(nodeName);
     }
 
     @Override

Modified: jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKCommitRemoveTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKCommitRemoveTest.java?rev=1421808&r1=1421807&r2=1421808&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKCommitRemoveTest.java
(original)
+++ jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKCommitRemoveTest.java
Fri Dec 14 12:10:01 2012
@@ -28,6 +28,8 @@ public class MongoMKCommitRemoveTest ext
     }
 
     @Test
+    @Ignore
+    // According to OAK-507, this should not fail.
     public void removeNonExistentNode() throws Exception {
         try {
             mk.commit("/", "-\"a\"", null, null);
@@ -36,7 +38,6 @@ public class MongoMKCommitRemoveTest ext
     }
 
     @Test
-    @Ignore("OAK-507") // FIXME
     public void removeNodeTwice() throws Exception {
         String base = mk.commit("", "+\"/a\":{}", null, null);
         mk.commit("", "-\"/a\"", base, null);



Mime
View raw message