jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1508095 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/core/ oak-core/src/test/java/org/apache/jackrabbit/oak/core/ oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/ oak-solr-core/src/t...
Date Mon, 29 Jul 2013 15:13:01 GMT
Author: mduerig
Date: Mon Jul 29 15:13:00 2013
New Revision: 1508095

URL: http://svn.apache.org/r1508095
Log:
OAK-932 RootImpl to AbstractRoot
Make RootImpl abstract and rename to AbstractRoot

Added:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/AbstractRoot.java
  (contents, props changed)
      - copied, changed from r1508057, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootFuzzIT.java
  (contents, props changed)
      - copied, changed from r1508057, jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootImplFuzzIT.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootTest.java
  (contents, props changed)
      - copied, changed from r1508057, jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootImplTest.java
Removed:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootImplFuzzIT.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootImplTest.java
Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentSessionImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ImmutableTree.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/MutableTree.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/SystemRoot.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/DefaultConflictHandlerOursTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/DefaultConflictHandlerTheirsTest.java
    jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/SolrBaseTest.java
    jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/index/SolrCommitHookIT.java
    jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrQueryEngineIT.java

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/AbstractRoot.java
(from r1508057, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/AbstractRoot.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/AbstractRoot.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java&r1=1508057&r2=1508095&rev=1508095&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/AbstractRoot.java
Mon Jul 29 15:13:00 2013
@@ -35,7 +35,6 @@ import javax.security.auth.Subject;
 import org.apache.jackrabbit.oak.api.Blob;
 import org.apache.jackrabbit.oak.api.BlobFactory;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
-import org.apache.jackrabbit.oak.api.ContentSession;
 import org.apache.jackrabbit.oak.api.QueryEngine;
 import org.apache.jackrabbit.oak.api.Root;
 import org.apache.jackrabbit.oak.api.Tree;
@@ -62,7 +61,7 @@ import org.apache.jackrabbit.oak.spi.sta
 import org.apache.jackrabbit.oak.spi.state.NodeStoreBranch;
 import org.apache.jackrabbit.oak.util.LazyValue;
 
-public class RootImpl implements Root {
+public abstract class AbstractRoot implements Root {
 
     /**
      * Number of {@link #updated} calls for which changes are kept in memory.
@@ -120,7 +119,7 @@ public class RootImpl implements Root {
     private LazyValue<PermissionProvider> permissionProvider = new LazyValue<PermissionProvider>()
{
         @Override
         protected PermissionProvider createValue() {
-            return getAcConfig().getPermissionProvider(RootImpl.this, subject.getPrincipals());
+            return getAcConfig().getPermissionProvider(AbstractRoot.this, subject.getPrincipals());
         }
     };
 
@@ -134,13 +133,13 @@ public class RootImpl implements Root {
      * @param securityProvider the security configuration.
      * @param indexProvider    the query index provider.
      */
-    public RootImpl(NodeStore store,
-                    CommitHook hook,
-                    PostCommitHook postHook,
-                    String workspaceName,
-                    Subject subject,
-                    SecurityProvider securityProvider,
-                    QueryIndexProvider indexProvider) {
+    protected AbstractRoot(NodeStore store,
+            CommitHook hook,
+            PostCommitHook postHook,
+            String workspaceName,
+            Subject subject,
+            SecurityProvider securityProvider,
+            QueryIndexProvider indexProvider) {
         this.store = checkNotNull(store);
         this.hook = checkNotNull(hook);
         this.postHook = postHook;
@@ -167,28 +166,9 @@ public class RootImpl implements Root {
 
     }
 
-    protected String getWorkspaceName() {
-        return workspaceName;
-    }
-
-    /**
-     * Factory method for creating a new {@code Root} instance, which
-     * reflects the latest state of the repository.
-     * @return  new Root instance
-     */
-    protected Root newRoot() {
-        return new RootImpl(
-                store, hook, postHook, workspaceName, subject, securityProvider, indexProvider);
-    }
-
     //---------------------------------------------------------------< Root >---
 
     @Override
-    public ContentSession getContentSession() {
-        throw new UnsupportedOperationException();
-    }
-
-    @Override
     public boolean move(String sourcePath, String destPath) {
         if (PathUtils.isAncestor(sourcePath, destPath)) {
             return false;
@@ -330,7 +310,7 @@ public class RootImpl implements Root {
 
             @Override
             protected NodeState getRootState() {
-                return RootImpl.this.getRootState();
+                return AbstractRoot.this.getRootState();
             }
 
             @Override

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/AbstractRoot.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/AbstractRoot.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentSessionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentSessionImpl.java?rev=1508095&r1=1508094&r2=1508095&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentSessionImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentSessionImpl.java
Mon Jul 29 15:13:00 2013
@@ -97,19 +97,18 @@ class ContentSessionImpl implements Cont
     @Override
     public Root getLatestRoot() {
         checkLive();
-        RootImpl root = new RootImpl(store, hook, changeDispatcher.newHook(this), workspaceName,
+        return new AbstractRoot(store, hook, changeDispatcher.newHook(ContentSessionImpl.this),
workspaceName,
                 loginContext.getSubject(), securityProvider, indexProvider) {
             @Override
             protected void checkLive() {
                 ContentSessionImpl.this.checkLive();
-            }            
- 
+            }
+
             @Override
             public ContentSession getContentSession() {
             	return ContentSessionImpl.this;
-            }            
+            }
         };
-        return root;
     }
 
     @Override

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ImmutableTree.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ImmutableTree.java?rev=1508095&r1=1508094&r2=1508095&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ImmutableTree.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ImmutableTree.java
Mon Jul 29 15:13:00 2013
@@ -125,8 +125,8 @@ public final class ImmutableTree extends
     }
 
     public static ImmutableTree createFromRoot(@Nonnull Root root, @Nonnull TreeTypeProvider
typeProvider) {
-        if (root instanceof RootImpl) {
-            return new ImmutableTree(((RootImpl) root).getBaseState(), typeProvider);
+        if (root instanceof AbstractRoot) {
+            return new ImmutableTree(((AbstractRoot) root).getBaseState(), typeProvider);
         } else if (root instanceof ImmutableRoot) {
             return ((ImmutableRoot) root).getTree("/");
         } else {

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/MutableTree.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/MutableTree.java?rev=1508095&r1=1508094&r2=1508095&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/MutableTree.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/MutableTree.java
Mon Jul 29 15:13:00 2013
@@ -18,8 +18,22 @@
  */
 package org.apache.jackrabbit.oak.core;
 
+import static com.google.common.base.Preconditions.checkArgument;
+import static com.google.common.base.Preconditions.checkNotNull;
+import static com.google.common.base.Preconditions.checkState;
+import static com.google.common.collect.Iterables.filter;
+import static com.google.common.collect.Iterables.indexOf;
+import static org.apache.jackrabbit.oak.api.Tree.Status.EXISTING;
+import static org.apache.jackrabbit.oak.api.Tree.Status.MODIFIED;
+import static org.apache.jackrabbit.oak.api.Tree.Status.NEW;
+import static org.apache.jackrabbit.oak.api.Type.STRING;
+import static org.apache.jackrabbit.oak.commons.PathUtils.elements;
+import static org.apache.jackrabbit.oak.commons.PathUtils.isAbsolute;
+import static org.apache.jackrabbit.oak.spi.state.NodeStateUtils.isHidden;
+
 import java.util.Collections;
 import java.util.Set;
+
 import javax.annotation.CheckForNull;
 import javax.annotation.Nonnull;
 
@@ -29,32 +43,19 @@ import com.google.common.collect.Sets;
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.api.Type;
-import org.apache.jackrabbit.oak.core.RootImpl.Move;
+import org.apache.jackrabbit.oak.core.AbstractRoot.Move;
 import org.apache.jackrabbit.oak.plugins.memory.MemoryPropertyBuilder;
 import org.apache.jackrabbit.oak.plugins.memory.MultiStringPropertyState;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 import org.apache.jackrabbit.oak.spi.state.PropertyBuilder;
 
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.base.Preconditions.checkState;
-import static com.google.common.collect.Iterables.filter;
-import static com.google.common.collect.Iterables.indexOf;
-import static org.apache.jackrabbit.oak.api.Tree.Status.EXISTING;
-import static org.apache.jackrabbit.oak.api.Tree.Status.MODIFIED;
-import static org.apache.jackrabbit.oak.api.Tree.Status.NEW;
-import static org.apache.jackrabbit.oak.api.Type.STRING;
-import static org.apache.jackrabbit.oak.commons.PathUtils.elements;
-import static org.apache.jackrabbit.oak.commons.PathUtils.isAbsolute;
-import static org.apache.jackrabbit.oak.spi.state.NodeStateUtils.isHidden;
-
 public class MutableTree extends AbstractTree {
 
     /**
      * Underlying {@code Root} of this {@code Tree} instance
      */
-    private final RootImpl root;
+    private final AbstractRoot root;
 
     /**
      * Parent of this tree. Null for the root.
@@ -64,13 +65,13 @@ public class MutableTree extends Abstrac
     /** Pointer into the list of pending moves */
     private Move pendingMoves;
 
-    MutableTree(RootImpl root, NodeBuilder builder, Move pendingMoves) {
+    MutableTree(AbstractRoot root, NodeBuilder builder, Move pendingMoves) {
         super("", builder);
         this.root = checkNotNull(root);
         this.pendingMoves = checkNotNull(pendingMoves);
     }
 
-    private MutableTree(RootImpl root, MutableTree parent, String name, Move pendingMoves)
{
+    private MutableTree(AbstractRoot root, MutableTree parent, String name, Move pendingMoves)
{
         super(name, parent.nodeBuilder.getChildNode(name));
         this.root = checkNotNull(root);
         this.parent = checkNotNull(parent);

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/SystemRoot.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/SystemRoot.java?rev=1508095&r1=1508094&r2=1508095&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/SystemRoot.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/SystemRoot.java
Mon Jul 29 15:13:00 2013
@@ -32,38 +32,41 @@ import org.apache.jackrabbit.oak.spi.sec
 import org.apache.jackrabbit.oak.spi.state.NodeStore;
 
 /**
- *  Internal extension of the {@link RootImpl} to be used
+ *  Internal extension of the {@link AbstractRoot} to be used
  *  when an usage of the system internal subject is needed.
  */
-public class SystemRoot extends RootImpl {
-    private final ContentSession contentSession = new ContentSession() {
-        private final AuthInfoImpl authInfo = new AuthInfoImpl(
-                null, null, SystemSubject.INSTANCE.getPrincipals());
-
-        @Override
-        public void close() {
-        }
-
-        @Override
-        public String getWorkspaceName() {
-            return SystemRoot.this.getWorkspaceName();
-        }
-
-        @Override
-        public Root getLatestRoot() {
-            return newRoot();
-        }
-
-        @Override
-        public AuthInfo getAuthInfo() {
-            return authInfo;
-        }
-    };
+public class SystemRoot extends AbstractRoot {
+    private final ContentSession contentSession;
+
+    public SystemRoot(final NodeStore store, final CommitHook hook, final String workspaceName,
+            final SecurityProvider securityProvider, final QueryIndexProvider indexProvider)
{
 
-    public SystemRoot(NodeStore store, CommitHook hook, String workspaceName,
-            SecurityProvider securityProvider, QueryIndexProvider indexProvider) {
         super(store, hook, PostCommitHook.EMPTY, workspaceName,
                 SystemSubject.INSTANCE, securityProvider, indexProvider);
+
+        contentSession = new ContentSession() {
+            private final AuthInfoImpl authInfo = new AuthInfoImpl(
+                    null, null, SystemSubject.INSTANCE.getPrincipals());
+
+            @Override
+            public void close() {
+            }
+
+            @Override
+            public String getWorkspaceName() {
+                return workspaceName;
+            }
+
+            @Override
+            public Root getLatestRoot() {
+                return new SystemRoot(store, hook, workspaceName, securityProvider, indexProvider);
+            }
+
+            @Override
+            public AuthInfo getAuthInfo() {
+                return authInfo;
+            }
+        };
     }
 
     public SystemRoot(NodeStore store) {
@@ -71,10 +74,9 @@ public class SystemRoot extends RootImpl
     }
 
     public SystemRoot(NodeStore store, CommitHook hook) {
-        // FIXME: define proper default or pass workspace name with the
-        // constructor
-        this(store, hook, Oak.DEFAULT_WORKSPACE_NAME,
-                new OpenSecurityProvider(), new CompositeQueryIndexProvider());
+        // FIXME: define proper default or pass workspace name with the constructor
+        this(store, hook, Oak.DEFAULT_WORKSPACE_NAME, new OpenSecurityProvider(),
+                new CompositeQueryIndexProvider());
     }
 
     @Override

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/DefaultConflictHandlerOursTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/DefaultConflictHandlerOursTest.java?rev=1508095&r1=1508094&r2=1508095&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/DefaultConflictHandlerOursTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/DefaultConflictHandlerOursTest.java
Mon Jul 29 15:13:00 2013
@@ -42,7 +42,7 @@ public class DefaultConflictHandlerOursT
     private static final String OUR_VALUE = "our value";
     private static final String THEIR_VALUE = "their value";
 
-    private RootImpl ourRoot;
+    private Root ourRoot;
     private Root theirRoot;
 
     @Before
@@ -63,7 +63,7 @@ public class DefaultConflictHandlerOursT
         tree.addChild("z");
         root.commit();
 
-        ourRoot = (RootImpl) session.getLatestRoot();
+        ourRoot = session.getLatestRoot();
         theirRoot = session.getLatestRoot();
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/DefaultConflictHandlerTheirsTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/DefaultConflictHandlerTheirsTest.java?rev=1508095&r1=1508094&r2=1508095&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/DefaultConflictHandlerTheirsTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/DefaultConflictHandlerTheirsTest.java
Mon Jul 29 15:13:00 2013
@@ -42,7 +42,7 @@ public class DefaultConflictHandlerTheir
     private static final String OUR_VALUE = "our value";
     private static final String THEIR_VALUE = "their value";
 
-    private RootImpl ourRoot;
+    private Root ourRoot;
     private Root theirRoot;
 
     @Before
@@ -63,7 +63,7 @@ public class DefaultConflictHandlerTheir
         tree.addChild("z");
         root.commit();
 
-        ourRoot = (RootImpl) session.getLatestRoot();
+        ourRoot = session.getLatestRoot();
         theirRoot = session.getLatestRoot();
     }
 

Copied: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootFuzzIT.java
(from r1508057, jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootImplFuzzIT.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootFuzzIT.java?p2=jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootFuzzIT.java&p1=jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootImplFuzzIT.java&r1=1508057&r2=1508095&rev=1508095&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootImplFuzzIT.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootFuzzIT.java
Mon Jul 29 15:13:00 2013
@@ -18,13 +18,13 @@
  */
 package org.apache.jackrabbit.oak.core;
 
-import static org.apache.jackrabbit.oak.core.RootImplFuzzIT.Operation.AddNode;
-import static org.apache.jackrabbit.oak.core.RootImplFuzzIT.Operation.CopyNode;
-import static org.apache.jackrabbit.oak.core.RootImplFuzzIT.Operation.MoveNode;
-import static org.apache.jackrabbit.oak.core.RootImplFuzzIT.Operation.RemoveNode;
-import static org.apache.jackrabbit.oak.core.RootImplFuzzIT.Operation.RemoveProperty;
-import static org.apache.jackrabbit.oak.core.RootImplFuzzIT.Operation.Save;
-import static org.apache.jackrabbit.oak.core.RootImplFuzzIT.Operation.SetProperty;
+import static org.apache.jackrabbit.oak.core.RootFuzzIT.Operation.AddNode;
+import static org.apache.jackrabbit.oak.core.RootFuzzIT.Operation.CopyNode;
+import static org.apache.jackrabbit.oak.core.RootFuzzIT.Operation.MoveNode;
+import static org.apache.jackrabbit.oak.core.RootFuzzIT.Operation.RemoveNode;
+import static org.apache.jackrabbit.oak.core.RootFuzzIT.Operation.RemoveProperty;
+import static org.apache.jackrabbit.oak.core.RootFuzzIT.Operation.Save;
+import static org.apache.jackrabbit.oak.core.RootFuzzIT.Operation.SetProperty;
 import static org.junit.Assert.assertEquals;
 
 import java.util.Iterator;
@@ -33,9 +33,10 @@ import java.util.Random;
 import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.mk.core.MicroKernelImpl;
 import org.apache.jackrabbit.oak.api.PropertyState;
+import org.apache.jackrabbit.oak.api.Root;
 import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.commons.PathUtils;
-import org.apache.jackrabbit.oak.core.RootImplFuzzIT.Operation.Rebase;
+import org.apache.jackrabbit.oak.core.RootFuzzIT.Operation.Rebase;
 import org.apache.jackrabbit.oak.kernel.KernelNodeStore;
 import org.junit.Before;
 import org.junit.Test;
@@ -44,25 +45,25 @@ import org.slf4j.LoggerFactory;
 
 /**
  * Fuzz test running random sequences of operations on {@link Tree}.
- * Run with -DRootImplFuzzIT-seed=42 to set a specific seed (i.e. 42);
+ * Run with -DRootFuzzIT-seed=42 to set a specific seed (i.e. 42);
  */
-public class RootImplFuzzIT {
+public class RootFuzzIT {
 
-    static final Logger log = LoggerFactory.getLogger(RootImplFuzzIT.class);
+    static final Logger log = LoggerFactory.getLogger(RootFuzzIT.class);
 
     private static final int OP_COUNT = 5000;
 
     private static final int SEED = Integer.getInteger(
-            RootImplFuzzIT.class.getSimpleName() + "-seed",
+            RootFuzzIT.class.getSimpleName() + "-seed",
             new Random().nextInt());
 
     private static final Random random = new Random(SEED);
 
     private KernelNodeStore store1;
-    private RootImpl root1;
+    private SystemRoot root1;
 
     private KernelNodeStore store2;
-    private RootImpl root2;
+    private SystemRoot root2;
 
     private int counter;
 
@@ -125,7 +126,7 @@ public class RootImplFuzzIT {
     }
 
     abstract static class Operation {
-        abstract void apply(RootImpl root);
+        abstract void apply(Root root);
 
         static class AddNode extends Operation {
             private final String parentPath;
@@ -137,7 +138,7 @@ public class RootImplFuzzIT {
             }
 
             @Override
-            void apply(RootImpl root) {
+            void apply(Root root) {
                 root.getTree(parentPath).addChild(name);
             }
 
@@ -155,7 +156,7 @@ public class RootImplFuzzIT {
             }
 
             @Override
-            void apply(RootImpl root) {
+            void apply(Root root) {
                 String parentPath = PathUtils.getParentPath(path);
                 String name = PathUtils.getName(path);
                 root.getTree(parentPath).getChild(name).remove();
@@ -177,7 +178,7 @@ public class RootImplFuzzIT {
             }
 
             @Override
-            void apply(RootImpl root) {
+            void apply(Root root) {
                 root.move(source, destination);
             }
 
@@ -197,7 +198,7 @@ public class RootImplFuzzIT {
             }
 
             @Override
-            void apply(RootImpl root) {
+            void apply(Root root) {
                 root.copy(source, destination);
             }
 
@@ -219,7 +220,7 @@ public class RootImplFuzzIT {
             }
 
             @Override
-            void apply(RootImpl root) {
+            void apply(Root root) {
                 root.getTree(parentPath).setProperty(propertyName, propertyValue);
             }
 
@@ -240,7 +241,7 @@ public class RootImplFuzzIT {
             }
 
             @Override
-            void apply(RootImpl root) {
+            void apply(Root root) {
                 root.getTree(parentPath).removeProperty(name);
             }
 
@@ -252,7 +253,7 @@ public class RootImplFuzzIT {
 
         static class Save extends Operation {
             @Override
-            void apply(RootImpl root) {
+            void apply(Root root) {
                 // empty
             }
 
@@ -264,7 +265,7 @@ public class RootImplFuzzIT {
 
         static class Rebase extends Operation {
             @Override
-            void apply(RootImpl root) {
+            void apply(Root root) {
                 root.rebase();
             }
 

Propchange: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootFuzzIT.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootFuzzIT.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Copied: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootTest.java
(from r1508057, jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootImplTest.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootTest.java?p2=jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootTest.java&p1=jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootImplTest.java&r1=1508057&r2=1508095&rev=1508095&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootImplTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootTest.java
Mon Jul 29 15:13:00 2013
@@ -38,7 +38,7 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
-public class RootImplTest extends OakBaseTest {
+public class RootTest extends OakBaseTest {
 
     private ContentSession session;
 

Propchange: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Modified: jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/SolrBaseTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/SolrBaseTest.java?rev=1508095&r1=1508094&r2=1508095&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/SolrBaseTest.java
(original)
+++ jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/SolrBaseTest.java
Mon Jul 29 15:13:00 2013
@@ -16,11 +16,13 @@
  */
 package org.apache.jackrabbit.oak.plugins.index.solr;
 
+import javax.annotation.Nonnull;
 import javax.security.auth.Subject;
 
 import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.mk.core.MicroKernelImpl;
-import org.apache.jackrabbit.oak.core.RootImpl;
+import org.apache.jackrabbit.oak.api.ContentSession;
+import org.apache.jackrabbit.oak.core.AbstractRoot;
 import org.apache.jackrabbit.oak.kernel.KernelNodeStore;
 import org.apache.jackrabbit.oak.plugins.index.IndexUpdateProvider;
 import org.apache.jackrabbit.oak.plugins.index.solr.index.SolrIndexEditorProvider;
@@ -66,9 +68,15 @@ public abstract class SolrBaseTest {
         }
     }
 
-    protected RootImpl createRootImpl() {
-        return new RootImpl(store, hook, PostCommitHook.EMPTY, "solr-query-engine-it", new
Subject(),
-                new OpenSecurityProvider(), new CompositeQueryIndexProvider());
+    protected AbstractRoot createRoot() {
+        return new AbstractRoot(store, hook, PostCommitHook.EMPTY, "solr-query-engine-it",
new Subject(),
+                new OpenSecurityProvider(), new CompositeQueryIndexProvider()) {
+            @Nonnull
+            @Override
+            public ContentSession getContentSession() {
+                throw new UnsupportedOperationException();
+            }
+        };
     }
 
     protected NodeState createInitialState(MicroKernel microKernel) {

Modified: jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/index/SolrCommitHookIT.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/index/SolrCommitHookIT.java?rev=1508095&r1=1508094&r2=1508095&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/index/SolrCommitHookIT.java
(original)
+++ jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/index/SolrCommitHookIT.java
Mon Jul 29 15:13:00 2013
@@ -18,17 +18,10 @@ package org.apache.jackrabbit.oak.plugin
 
 import static org.junit.Assert.assertTrue;
 
-import javax.security.auth.Subject;
-
 import org.apache.jackrabbit.oak.api.Root;
-import org.apache.jackrabbit.oak.core.RootImpl;
 import org.apache.jackrabbit.oak.plugins.index.solr.SolrBaseTest;
-import org.apache.jackrabbit.oak.spi.commit.PostCommitHook;
-import org.apache.jackrabbit.oak.spi.query.CompositeQueryIndexProvider;
-import org.apache.jackrabbit.oak.spi.security.OpenSecurityProvider;
 import org.apache.solr.client.solrj.SolrQuery;
 import org.apache.solr.client.solrj.response.QueryResponse;
-import org.apache.solr.common.SolrInputDocument;
 import org.junit.Test;
 
 /**
@@ -38,7 +31,7 @@ public class SolrCommitHookIT extends So
 
     @Test
     public void testAddSomeNodes() throws Exception {
-        Root r = createRootImpl();
+        Root r = createRoot();
         r.getTree("/").addChild("a").addChild("b").addChild("doc1").
                 setProperty("text", "hit that hot hat tattoo");
         r.getTree("/").getChild("a").addChild("c").addChild("doc2").
@@ -57,7 +50,7 @@ public class SolrCommitHookIT extends So
 
     @Test
     public void testRemoveNode() throws Exception {
-        Root r = createRootImpl();
+        Root r = createRoot();
 
         // Add a node
         r.getTree("/").addChild("testRemoveNode").setProperty("foo", "bar");

Modified: jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrQueryEngineIT.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrQueryEngineIT.java?rev=1508095&r1=1508094&r2=1508095&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrQueryEngineIT.java
(original)
+++ jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrQueryEngineIT.java
Mon Jul 29 15:13:00 2013
@@ -40,7 +40,7 @@ public class SolrQueryEngineIT extends S
 
     @Test
     public void testSolrQueryEngine() throws Exception {
-        Root root = createRootImpl();
+        Root root = createRoot();
         Tree tree = root.getTree("/");
         tree.addChild("somenode").setProperty("foo", "bar");
         root.commit();



Mime
View raw message