jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1515369 - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStoreBranch.java test/java/org/apache/jackrabbit/oak/core/RootTest.java test/java/org/apache/jackrabbit/oak/kernel/NodeStoreTest.java
Date Mon, 19 Aug 2013 11:39:28 GMT
Author: mduerig
Date: Mon Aug 19 11:39:28 2013
New Revision: 1515369

URL: http://svn.apache.org/r1515369
Log:
OAK-963: Clarify NodeStoreBranch.move() contract for move to self
Changed test expectations and fixed

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStoreBranch.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/NodeStoreTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStoreBranch.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStoreBranch.java?rev=1515369&r1=1515368&r2=1515369&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStoreBranch.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStoreBranch.java
Mon Aug 19 11:39:28 2013
@@ -28,6 +28,7 @@ import java.util.concurrent.locks.Lock;
 import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.mk.api.MicroKernelException;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
+import org.apache.jackrabbit.oak.commons.PathUtils;
 import org.apache.jackrabbit.oak.spi.commit.CommitHook;
 import org.apache.jackrabbit.oak.spi.commit.PostCommitHook;
 import org.apache.jackrabbit.oak.spi.state.AbstractNodeStoreBranch;
@@ -104,6 +105,12 @@ class KernelNodeStoreBranch extends Abst
     @Override
     public boolean move(String source, String target) {
         checkNotMerged();
+        if (PathUtils.isAncestor(source, target)) {
+            return false;
+        } else if (source.equals(target)) {
+            return true;
+        }
+
         if (!getNode(source).exists()) {
             // source does not exist
             return false;

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootTest.java?rev=1515369&r1=1515368&r2=1515369&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootTest.java
Mon Aug 19 11:39:28 2013
@@ -177,14 +177,11 @@ public class RootTest extends OakBaseTes
 
     @Test
     public void moveToSelf() throws CommitFailedException {
-        // FIXME fails on SegmentMK. See OAK-963
-        assumeTrue(fixture != NodeStoreFixture.SEGMENT_MK);
-
         Root root = session.getLatestRoot();
         root.getTree("/").addChild("s");
         root.commit();
 
-        assertFalse(root.move("/s", "/s"));
+        assertTrue(root.move("/s", "/s"));
     }
 
     @Test

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/NodeStoreTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/NodeStoreTest.java?rev=1515369&r1=1515368&r2=1515369&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/NodeStoreTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/NodeStoreTest.java
Mon Aug 19 11:39:28 2013
@@ -323,11 +323,8 @@ public class NodeStoreTest {
 
     @Test
     public void moveToSelf() throws CommitFailedException {
-        // FIXME fails on SegmentMK. See OAK-963
-        assumeTrue(fixture != NodeStoreFixture.SEGMENT_MK);
-
         NodeStoreBranch branch = store.branch();
-        assertFalse(branch.move("/x", "/x"));
+        assertTrue(branch.move("/x", "/x"));
     }
 
     @Test



Mime
View raw message