Author: angela
Date: Wed Sep 27 12:48:33 2017
New Revision: 1809844
URL: http://svn.apache.org/viewvc?rev=1809844&view=rev
Log:
OAK-6731 : Remove implementation dependencies in non-factory classes
Added:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/ReadOnly.java
(with props)
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/TreeConstants.java
- copied, changed from r1809762,
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/impl/TreeConstants.java
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/TreeTypeAware.java
(with props)
Removed:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/impl/TreeConstants.java
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ImmutableRoot.java
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/ChildOrderConflictHandler.java
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/MergingNodeStateDiff.java
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/migration/AbstractDecoratedNodeState.java
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/EventGenerator.java
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/TreeTypeProvider.java
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/TreeUtil.java
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/impl/AbstractMutableTree.java
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/impl/AbstractTree.java
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/impl/ImmutableTree.java
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/package-info.java
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/VersionableState.java
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/accesscontrol/AccessControlValidator.java
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/ChildOrderDiff.java
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/PermissionStoreEditor.java
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/PermissionValidator.java
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/Context.java
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/importer/JsonDeserializationTest.java
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/migration/FilteringNodeStateTest.java
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/tree/TreeLocationTest.java
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/tree/TreeTypeProviderTest.java
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/tree/impl/ImmutableTreeTest.java
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/AuthorizationContextTest.java
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/ChildOrderPropertyTest.java
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/HiddenPropertyTest.java
jackrabbit/oak/trunk/oak-it/src/test/java/org/apache/jackrabbit/oak/core/MutableTreeTest.java
jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/version/HiddenNodeTest.java
jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/IndexDefinition.java
jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/IndexDefinitionTest.java
jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/NodeStateAnalyzerFactoryTest.java
jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/JackrabbitNodeState.java
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ImmutableRoot.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ImmutableRoot.java?rev=1809844&r1=1809843&r2=1809844&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ImmutableRoot.java
(original)
+++
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ImmutableRoot.java
Wed Sep 27 12:48:33 2017
@@ -32,6 +32,7 @@ import org.apache.jackrabbit.oak.api.Que
import org.apache.jackrabbit.oak.api.Root;
import org.apache.jackrabbit.oak.commons.PathUtils;
import org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexProvider;
+import org.apache.jackrabbit.oak.plugins.tree.ReadOnly;
import org.apache.jackrabbit.oak.plugins.tree.impl.ImmutableTree;
import org.apache.jackrabbit.oak.query.ExecutionContext;
import org.apache.jackrabbit.oak.query.QueryEngineImpl;
@@ -44,7 +45,7 @@ import org.apache.jackrabbit.oak.spi.sta
* passed to the constructor. This root implementation provides a query engine
* with index support limited to the {@link PropertyIndexProvider}.
*/
-public final class ImmutableRoot implements Root {
+public final class ImmutableRoot implements Root, ReadOnly {
private final ImmutableTree rootTree;
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/ChildOrderConflictHandler.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/ChildOrderConflictHandler.java?rev=1809844&r1=1809843&r2=1809844&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/ChildOrderConflictHandler.java
(original)
+++
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/ChildOrderConflictHandler.java
Wed Sep 27 12:48:33 2017
@@ -22,7 +22,7 @@ import com.google.common.collect.Sets;
import org.apache.jackrabbit.oak.api.PropertyState;
import org.apache.jackrabbit.oak.api.Type;
import org.apache.jackrabbit.oak.plugins.memory.PropertyBuilder;
-import org.apache.jackrabbit.oak.plugins.tree.impl.TreeConstants;
+import org.apache.jackrabbit.oak.plugins.tree.TreeConstants;
import org.apache.jackrabbit.oak.spi.commit.PartialConflictHandler;
import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
import org.apache.jackrabbit.oak.spi.state.NodeState;
@@ -31,7 +31,7 @@ import org.apache.jackrabbit.oak.spi.sta
* This conflict handler instance takes care of properly merging conflicts
* occurring by concurrent reorder operations.
*
- * @see
org.apache.jackrabbit.oak.plugins.tree.impl.TreeConstants#OAK_CHILD_ORDER
+ * @see TreeConstants#OAK_CHILD_ORDER
*/
public class ChildOrderConflictHandler implements PartialConflictHandler {
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/MergingNodeStateDiff.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/MergingNodeStateDiff.java?rev=1809844&r1=1809843&r2=1809844&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/MergingNodeStateDiff.java
(original)
+++
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/MergingNodeStateDiff.java
Wed Sep 27 12:48:33 2017
@@ -39,7 +39,7 @@ import com.google.common.collect.Sets;
import org.apache.jackrabbit.oak.api.PropertyState;
import org.apache.jackrabbit.oak.json.JsopDiff;
import org.apache.jackrabbit.oak.plugins.memory.PropertyBuilder;
-import org.apache.jackrabbit.oak.plugins.tree.impl.TreeConstants;
+import org.apache.jackrabbit.oak.plugins.tree.TreeConstants;
import org.apache.jackrabbit.oak.spi.commit.ThreeWayConflictHandler.Resolution;
import org.apache.jackrabbit.oak.spi.commit.ThreeWayConflictHandler;
import org.apache.jackrabbit.oak.spi.state.ChildNodeEntry;
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/migration/AbstractDecoratedNodeState.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/migration/AbstractDecoratedNodeState.java?rev=1809844&r1=1809843&r2=1809844&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/migration/AbstractDecoratedNodeState.java
(original)
+++
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/migration/AbstractDecoratedNodeState.java
Wed Sep 27 12:48:33 2017
@@ -39,7 +39,7 @@ import java.util.Collection;
import java.util.Collections;
import static com.google.common.base.Predicates.notNull;
-import static
org.apache.jackrabbit.oak.plugins.tree.impl.TreeConstants.OAK_CHILD_ORDER;
+import static
org.apache.jackrabbit.oak.plugins.tree.TreeConstants.OAK_CHILD_ORDER;
public abstract class AbstractDecoratedNodeState extends AbstractNodeState {
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/EventGenerator.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/EventGenerator.java?rev=1809844&r1=1809843&r2=1809844&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/EventGenerator.java
(original)
+++
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/EventGenerator.java
Wed Sep 27 12:48:33 2017
@@ -23,7 +23,7 @@ import static com.google.common.collect.
import static com.google.common.collect.Sets.newHashSet;
import static org.apache.jackrabbit.oak.api.Type.NAMES;
import static org.apache.jackrabbit.oak.api.Type.STRING;
-import static
org.apache.jackrabbit.oak.plugins.tree.impl.TreeConstants.OAK_CHILD_ORDER;
+import static
org.apache.jackrabbit.oak.plugins.tree.TreeConstants.OAK_CHILD_ORDER;
import static
org.apache.jackrabbit.oak.plugins.memory.EmptyNodeState.MISSING_NODE;
import static org.apache.jackrabbit.oak.spi.state.MoveDetector.SOURCE_PATH;
Added:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/ReadOnly.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/ReadOnly.java?rev=1809844&view=auto
==============================================================================
---
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/ReadOnly.java
(added)
+++
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/ReadOnly.java
Wed Sep 27 12:48:33 2017
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.oak.plugins.tree;
+
+/**
+ * Marker interface to indicate if a {@link Tree} or {@link
org.apache.jackrabbit.oak.api.Root}
+ * can only be read (write operations not implemented).
+ */
+public interface ReadOnly {
+}
\ No newline at end of file
Propchange:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/ReadOnly.java
------------------------------------------------------------------------------
svn:eol-style = native
Copied:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/TreeConstants.java
(from r1809762,
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/impl/TreeConstants.java)
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/TreeConstants.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/TreeConstants.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/impl/TreeConstants.java&r1=1809762&r2=1809844&rev=1809844&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/impl/TreeConstants.java
(original)
+++
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/TreeConstants.java
Wed Sep 27 12:48:33 2017
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.jackrabbit.oak.plugins.tree.impl;
+package org.apache.jackrabbit.oak.plugins.tree;
public interface TreeConstants {
Added:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/TreeTypeAware.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/TreeTypeAware.java?rev=1809844&view=auto
==============================================================================
---
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/TreeTypeAware.java
(added)
+++
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/TreeTypeAware.java
Wed Sep 27 12:48:33 2017
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.oak.plugins.tree;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nonnull;
+
+public interface TreeTypeAware {
+
+ @CheckForNull
+ TreeType getType();
+
+ void setType(@Nonnull TreeType type);
+}
\ No newline at end of file
Propchange:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/TreeTypeAware.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/TreeTypeProvider.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/TreeTypeProvider.java?rev=1809844&r1=1809843&r2=1809844&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/TreeTypeProvider.java
(original)
+++
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/TreeTypeProvider.java
Wed Sep 27 12:48:33 2017
@@ -20,8 +20,6 @@ import javax.annotation.Nonnull;
import org.apache.jackrabbit.JcrConstants;
import org.apache.jackrabbit.oak.api.Tree;
-import org.apache.jackrabbit.oak.plugins.tree.impl.ImmutableTree;
-import org.apache.jackrabbit.oak.spi.version.VersionConstants;
import org.apache.jackrabbit.oak.spi.state.NodeStateUtils;
import org.apache.jackrabbit.oak.spi.version.VersionConstants;
@@ -38,11 +36,11 @@ public final class TreeTypeProvider {
return TreeType.DEFAULT;
} else {
TreeType type;
- if (tree instanceof ImmutableTree) {
- type = ((ImmutableTree) tree).getType();
+ if (tree instanceof TreeTypeAware) {
+ type = ((TreeTypeAware) tree).getType();
if (type == null) {
type = internalGetType(tree);
- ((ImmutableTree) tree).setType(type);
+ ((TreeTypeAware) tree).setType(type);
}
} else {
type = internalGetType(tree);
@@ -57,11 +55,11 @@ public final class TreeTypeProvider {
}
TreeType type;
- if (tree instanceof ImmutableTree) {
- type = ((ImmutableTree) tree).getType();
+ if (tree instanceof TreeTypeAware) {
+ type = ((TreeTypeAware) tree).getType();
if (type == null) {
type = internalGetType(tree, parentType);
- ((ImmutableTree) tree).setType(type);
+ ((TreeTypeAware) tree).setType(type);
}
} else {
type = internalGetType(tree, parentType);
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/TreeUtil.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/TreeUtil.java?rev=1809844&r1=1809843&r2=1809844&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/TreeUtil.java
(original)
+++
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/TreeUtil.java
Wed Sep 27 12:48:33 2017
@@ -41,7 +41,6 @@ import org.apache.jackrabbit.oak.commons
import org.apache.jackrabbit.oak.commons.UUIDUtils;
import org.apache.jackrabbit.oak.plugins.memory.PropertyStates;
import org.apache.jackrabbit.oak.spi.nodetype.NodeTypeConstants;
-import org.apache.jackrabbit.oak.plugins.tree.impl.ImmutableTree;
import org.apache.jackrabbit.util.ISO8601;
import static com.google.common.collect.Iterables.contains;
@@ -499,6 +498,6 @@ public final class TreeUtil {
* @see
org.apache.jackrabbit.oak.plugins.tree.RootFactory#createReadOnlyRoot(org.apache.jackrabbit.oak.spi.state.NodeState)
*/
public static boolean isReadOnlyTree(@Nonnull Tree tree) {
- return tree instanceof ImmutableTree;
+ return tree instanceof ReadOnly;
}
}
\ No newline at end of file
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/impl/AbstractMutableTree.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/impl/AbstractMutableTree.java?rev=1809844&r1=1809843&r2=1809844&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/impl/AbstractMutableTree.java
(original)
+++
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/impl/AbstractMutableTree.java
Wed Sep 27 12:48:33 2017
@@ -23,7 +23,7 @@ import static com.google.common.base.Pre
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.collect.Lists.newArrayListWithCapacity;
import static org.apache.jackrabbit.oak.api.Type.NAMES;
-import static
org.apache.jackrabbit.oak.plugins.tree.impl.TreeConstants.OAK_CHILD_ORDER;
+import static
org.apache.jackrabbit.oak.plugins.tree.TreeConstants.OAK_CHILD_ORDER;
import java.util.List;
@@ -34,6 +34,7 @@ import org.apache.jackrabbit.oak.api.Pro
import org.apache.jackrabbit.oak.api.Tree;
import org.apache.jackrabbit.oak.api.Type;
import org.apache.jackrabbit.oak.plugins.memory.PropertyStates;
+import org.apache.jackrabbit.oak.plugins.tree.TreeConstants;
import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
/**
@@ -99,7 +100,7 @@ public abstract class AbstractMutableTre
/**
* Updates the child order to match any added or removed child nodes that
- * are not yet reflected in the {@link
org.apache.jackrabbit.oak.plugins.tree.impl.TreeConstants#OAK_CHILD_ORDER}
+ * are not yet reflected in the {@link TreeConstants#OAK_CHILD_ORDER}
* property. If the {@code force} flag is set, the child order is set
* in any case, otherwise only if the node already is orderable.
*
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/impl/AbstractTree.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/impl/AbstractTree.java?rev=1809844&r1=1809843&r2=1809844&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/impl/AbstractTree.java
(original)
+++
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/impl/AbstractTree.java
Wed Sep 27 12:48:33 2017
@@ -29,7 +29,7 @@ import static org.apache.jackrabbit.oak.
import static org.apache.jackrabbit.oak.api.Tree.Status.NEW;
import static org.apache.jackrabbit.oak.api.Tree.Status.UNCHANGED;
import static org.apache.jackrabbit.oak.api.Type.NAMES;
-import static
org.apache.jackrabbit.oak.plugins.tree.impl.TreeConstants.OAK_CHILD_ORDER;
+import static
org.apache.jackrabbit.oak.plugins.tree.TreeConstants.OAK_CHILD_ORDER;
import java.util.Iterator;
import java.util.List;
@@ -46,6 +46,7 @@ import org.apache.jackrabbit.oak.api.Tre
import org.apache.jackrabbit.oak.commons.PathUtils;
import org.apache.jackrabbit.oak.plugins.index.IndexConstants;
import
org.apache.jackrabbit.oak.plugins.index.reference.NodeReferenceConstants;
+import org.apache.jackrabbit.oak.plugins.tree.TreeConstants;
import org.apache.jackrabbit.oak.spi.state.ConflictAnnotatingRebaseDiff;
import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
import org.apache.jackrabbit.oak.spi.state.NodeState;
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/impl/ImmutableTree.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/impl/ImmutableTree.java?rev=1809844&r1=1809843&r2=1809844&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/impl/ImmutableTree.java
(original)
+++
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/impl/ImmutableTree.java
Wed Sep 27 12:48:33 2017
@@ -25,7 +25,9 @@ import org.apache.jackrabbit.oak.api.Pro
import org.apache.jackrabbit.oak.api.Tree;
import org.apache.jackrabbit.oak.api.Type;
import org.apache.jackrabbit.oak.commons.PathUtils;
+import org.apache.jackrabbit.oak.plugins.tree.ReadOnly;
import org.apache.jackrabbit.oak.plugins.tree.TreeType;
+import org.apache.jackrabbit.oak.plugins.tree.TreeTypeAware;
import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
import org.apache.jackrabbit.oak.spi.state.NodeState;
import org.apache.jackrabbit.oak.spi.state.ReadOnlyBuilder;
@@ -78,7 +80,7 @@ import org.apache.jackrabbit.oak.spi.sta
* however, that according to the contract defined in {@code NodeState} these
* objects are not expected to be used as hash keys.
*/
-public final class ImmutableTree extends AbstractTree {
+public final class ImmutableTree extends AbstractTree implements
TreeTypeAware, ReadOnly {
/**
* Underlying node state
@@ -110,11 +112,13 @@ public final class ImmutableTree extends
this.parentProvider = parentProvider;
}
+ //----------------------------------------------------------< TypeAware
>---
+ @CheckForNull
public TreeType getType() {
return type;
}
- public void setType(TreeType type) {
+ public void setType(@Nonnull TreeType type) {
this.type = type;
}
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/package-info.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/package-info.java?rev=1809844&r1=1809843&r2=1809844&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/package-info.java
(original)
+++
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/package-info.java
Wed Sep 27 12:48:33 2017
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-@Version("2.2.0")
+@Version("2.3.0")
package org.apache.jackrabbit.oak.plugins.tree;
import org.osgi.annotation.versioning.Version;
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/VersionableState.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/VersionableState.java?rev=1809844&r1=1809843&r2=1809844&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/VersionableState.java
(original)
+++
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/VersionableState.java
Wed Sep 27 12:48:33 2017
@@ -67,7 +67,7 @@ import org.apache.jackrabbit.oak.plugins
import org.apache.jackrabbit.oak.plugins.nodetype.ReadOnlyNodeTypeManager;
import org.apache.jackrabbit.oak.plugins.tree.TreeFactory;
import org.apache.jackrabbit.oak.plugins.tree.impl.ImmutableTree;
-import org.apache.jackrabbit.oak.plugins.tree.impl.TreeConstants;
+import org.apache.jackrabbit.oak.plugins.tree.TreeConstants;
import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
import org.apache.jackrabbit.oak.spi.state.NodeState;
import org.apache.jackrabbit.oak.spi.state.NodeStateUtils;
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/accesscontrol/AccessControlValidator.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/accesscontrol/AccessControlValidator.java?rev=1809844&r1=1809843&r2=1809844&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/accesscontrol/AccessControlValidator.java
(original)
+++
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/accesscontrol/AccessControlValidator.java
Wed Sep 27 12:48:33 2017
@@ -38,7 +38,7 @@ import org.apache.jackrabbit.oak.api.Typ
import org.apache.jackrabbit.oak.plugins.nodetype.TypePredicate;
import org.apache.jackrabbit.oak.plugins.tree.TreeFactory;
import org.apache.jackrabbit.oak.plugins.tree.impl.AbstractTree;
-import org.apache.jackrabbit.oak.plugins.tree.impl.TreeConstants;
+import org.apache.jackrabbit.oak.plugins.tree.TreeConstants;
import org.apache.jackrabbit.oak.spi.commit.DefaultValidator;
import org.apache.jackrabbit.oak.spi.commit.Validator;
import org.apache.jackrabbit.oak.spi.commit.VisibleValidator;
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/ChildOrderDiff.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/ChildOrderDiff.java?rev=1809844&r1=1809843&r2=1809844&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/ChildOrderDiff.java
(original)
+++
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/ChildOrderDiff.java
Wed Sep 27 12:48:33 2017
@@ -22,12 +22,13 @@ import javax.annotation.CheckForNull;
import org.apache.jackrabbit.oak.api.PropertyState;
import org.apache.jackrabbit.oak.api.Type;
+import org.apache.jackrabbit.oak.plugins.tree.TreeConstants;
import static com.google.common.collect.Sets.newLinkedHashSet;
/**
* Helper class to handle modifications to the hidden
- * {@link
org.apache.jackrabbit.oak.plugins.tree.impl.TreeConstants#OAK_CHILD_ORDER}
property.
+ * {@link TreeConstants#OAK_CHILD_ORDER} property.
*/
final class ChildOrderDiff {
@@ -35,7 +36,7 @@ final class ChildOrderDiff {
/**
* Tests if there was any user-supplied reordering involved with the
- * modification of the {@link
org.apache.jackrabbit.oak.plugins.tree.impl.TreeConstants#OAK_CHILD_ORDER}
+ * modification of the {@link TreeConstants#OAK_CHILD_ORDER}
* property.
*
* @param before
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/PermissionStoreEditor.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/PermissionStoreEditor.java?rev=1809844&r1=1809843&r2=1809844&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/PermissionStoreEditor.java
(original)
+++
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/PermissionStoreEditor.java
Wed Sep 27 12:48:33 2017
@@ -47,7 +47,7 @@ import org.slf4j.LoggerFactory;
import static com.google.common.collect.Iterables.addAll;
import static com.google.common.collect.Sets.newLinkedHashSet;
import static org.apache.jackrabbit.JcrConstants.JCR_PRIMARYTYPE;
-import static
org.apache.jackrabbit.oak.plugins.tree.impl.TreeConstants.OAK_CHILD_ORDER;
+import static
org.apache.jackrabbit.oak.plugins.tree.TreeConstants.OAK_CHILD_ORDER;
final class PermissionStoreEditor implements AccessControlConstants,
PermissionConstants {
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/PermissionValidator.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/PermissionValidator.java?rev=1809844&r1=1809843&r2=1809844&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/PermissionValidator.java
(original)
+++
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/PermissionValidator.java
Wed Sep 27 12:48:33 2017
@@ -29,7 +29,7 @@ import org.apache.jackrabbit.oak.plugins
import org.apache.jackrabbit.oak.plugins.tree.impl.ImmutableTree;
import org.apache.jackrabbit.oak.plugins.lock.LockConstants;
import org.apache.jackrabbit.oak.plugins.nodetype.TypePredicate;
-import org.apache.jackrabbit.oak.plugins.tree.impl.TreeConstants;
+import org.apache.jackrabbit.oak.plugins.tree.TreeConstants;
import org.apache.jackrabbit.oak.spi.version.VersionConstants;
import org.apache.jackrabbit.oak.spi.commit.DefaultValidator;
import org.apache.jackrabbit.oak.spi.commit.Validator;
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/Context.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/Context.java?rev=1809844&r1=1809843&r2=1809844&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/Context.java
(original)
+++
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/Context.java
Wed Sep 27 12:48:33 2017
@@ -22,7 +22,6 @@ import org.apache.jackrabbit.oak.api.Pro
import org.apache.jackrabbit.oak.api.Tree;
import org.apache.jackrabbit.oak.plugins.tree.TreeContext;
import org.apache.jackrabbit.oak.plugins.tree.TreeLocation;
-import org.osgi.annotation.versioning.ProviderType;
/**
* {@code Context} represents item related information in relation to a
Modified:
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/importer/JsonDeserializationTest.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/importer/JsonDeserializationTest.java?rev=1809844&r1=1809843&r2=1809844&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/importer/JsonDeserializationTest.java
(original)
+++
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/importer/JsonDeserializationTest.java
Wed Sep 27 12:48:33 2017
@@ -28,7 +28,6 @@ import org.apache.jackrabbit.oak.json.Ba
import org.apache.jackrabbit.oak.json.BlobSerializer;
import org.apache.jackrabbit.oak.json.JsonDeserializer;
import org.apache.jackrabbit.oak.json.JsonSerializer;
-import org.apache.jackrabbit.oak.json.JsopDiff;
import org.apache.jackrabbit.oak.plugins.tree.TreeFactory;
import org.apache.jackrabbit.oak.spi.state.EqualsDiff;
import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
Modified:
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/migration/FilteringNodeStateTest.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/migration/FilteringNodeStateTest.java?rev=1809844&r1=1809843&r2=1809844&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/migration/FilteringNodeStateTest.java
(original)
+++
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/migration/FilteringNodeStateTest.java
Wed Sep 27 12:48:33 2017
@@ -42,7 +42,7 @@ import static org.apache.jackrabbit.oak.
import static
org.apache.jackrabbit.oak.plugins.migration.NodeStateTestUtils.commit;
import static
org.apache.jackrabbit.oak.plugins.migration.NodeStateTestUtils.createNodeStoreWithContent;
import static
org.apache.jackrabbit.oak.plugins.migration.NodeStateTestUtils.getNodeState;
-import static
org.apache.jackrabbit.oak.plugins.tree.impl.TreeConstants.OAK_CHILD_ORDER;
+import static
org.apache.jackrabbit.oak.plugins.tree.TreeConstants.OAK_CHILD_ORDER;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
Modified:
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/tree/TreeLocationTest.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/tree/TreeLocationTest.java?rev=1809844&r1=1809843&r2=1809844&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/tree/TreeLocationTest.java
(original)
+++
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/tree/TreeLocationTest.java
Wed Sep 27 12:48:33 2017
@@ -18,57 +18,93 @@
*/
package org.apache.jackrabbit.oak.plugins.tree;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-
-import org.apache.jackrabbit.JcrConstants;
-import org.apache.jackrabbit.oak.AbstractSecurityTest;
+import org.apache.jackrabbit.oak.api.Root;
import org.apache.jackrabbit.oak.api.Tree;
-import org.apache.jackrabbit.oak.util.NodeUtil;
-import org.junit.After;
-import org.junit.Assert;
+import org.apache.jackrabbit.oak.api.Type;
+import org.apache.jackrabbit.oak.commons.PathUtils;
+import org.apache.jackrabbit.oak.plugins.memory.PropertyStates;
import org.junit.Before;
import org.junit.Test;
+import org.mockito.Mockito;
-public class TreeLocationTest extends AbstractSecurityTest {
-
- private TreeLocation nullLocation;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.when;
+
+public class TreeLocationTest {
+
+ private Tree rootTree;
+ private Tree nonExisting;
+ private Root root;
@Before
public void setUp() throws Exception {
- Tree tree = root.getTree("/");
- tree.setProperty("a", 1);
- tree.setProperty("b", 2);
- tree.setProperty("c", 3);
-
- NodeUtil n = new NodeUtil(tree);
- n.addChild("x", JcrConstants.NT_UNSTRUCTURED);
- n.addChild("y", JcrConstants.NT_UNSTRUCTURED);
- n.addChild("z", JcrConstants.NT_UNSTRUCTURED).addChild("1",
JcrConstants.NT_UNSTRUCTURED).addChild("2",
JcrConstants.NT_UNSTRUCTURED).setString("p", "v");
- root.commit();
-
- nullLocation = TreeLocation.create(root).getParent();
- }
-
- @After
- public void tearDown() {
- root = null;
+
+ rootTree = mockTree("/", null);
+ when(rootTree.hasProperty("p")).thenReturn(true);
+
when(rootTree.getProperty("p")).thenReturn(PropertyStates.createProperty("p",
1));
+
+ nonExisting = Mockito.mock(Tree.class);
+ when(nonExisting.exists()).thenReturn(false);
+ when(nonExisting.getName()).thenReturn("nonExisting");
+
+ Tree x = mockTree("/x", rootTree);
+ Tree subTree = mockTree("/z", rootTree);
+ Tree child = mockTree("/z/child", subTree);
+ when(child.hasProperty("p")).thenReturn(true);
+
when(child.getProperty("p")).thenReturn(PropertyStates.createProperty("p",
"value"));
+
+ when(subTree.getChild("child")).thenReturn(child);
+ when(rootTree.getChild("z")).thenReturn(subTree);
+ when(rootTree.getChild("x")).thenReturn(x);
+
+ root = Mockito.mock(Root.class);
+ when(root.getTree("/")).thenReturn(rootTree);
+ }
+
+ private Tree mockTree(String path, Tree parent) {
+ Tree t = Mockito.mock(Tree.class);
+ when(t.getPath()).thenReturn(path);
+ when(t.getName()).thenReturn(PathUtils.getName(path));
+ if (PathUtils.denotesRoot(path)) {
+ when(t.getParent()).thenThrow(IllegalStateException.class);
+ when(t.isRoot()).thenReturn(true);
+ } else {
+ when(t.getParent()).thenReturn(parent);
+ when(t.isRoot()).thenReturn(false);
+ }
+ when(t.exists()).thenReturn(true);
+ when(t.hasProperty("nonExisting")).thenReturn(false);
+ when(t.hasChild("nonExisting")).thenReturn(false);
+ when(t.getChild("nonExisting")).thenReturn(nonExisting);
+ return t;
}
@Test
public void testNullLocation() {
- TreeLocation xyz =
nullLocation.getChild("x").getChild("y").getChild("z");
- Assert.assertEquals("x/y/z", xyz.getPath());
- assertEquals("x/y", xyz.getParent().getPath());
- assertEquals("x", xyz.getParent().getParent().getPath());
- assertEquals(nullLocation, xyz.getParent().getParent().getParent());
+ TreeLocation nullLocation = TreeLocation.create(root).getParent();
+ assertNull(nullLocation.getTree());
+ assertTrue(nullLocation.getName().isEmpty());
+
+ TreeLocation child = nullLocation.getChild("any");
+ assertNotNull(child);
+ assertNull(child.getTree());
+ assertNull(child.getProperty());
+
+ TreeLocation child2 = nullLocation.getChild("x");
+ assertNotNull(child2);
+ assertNull(child.getTree());
+ assertNull(child.getProperty());
}
@Test
public void testParentOfRoot() {
- TreeLocation rootLocation = TreeLocation.create(root);
- assertEquals(nullLocation, rootLocation.getParent());
+ TreeLocation nullLocation = TreeLocation.create(root).getParent();
+ assertSame(nullLocation, nullLocation.getParent());
+ assertTrue(nullLocation.getName().isEmpty());
}
@Test
@@ -76,46 +112,47 @@ public class TreeLocationTest extends Ab
TreeLocation x = TreeLocation.create(root, "/x");
assertNotNull(x.getTree());
- TreeLocation xyz = x.getChild("y").getChild("z");
- assertEquals("/x/y/z", xyz.getPath());
- assertNull(xyz.getTree());
-
- TreeLocation xy = xyz.getParent();
- assertEquals("/x/y", xy.getPath());
- assertNull(xy.getTree());
-
- assertEquals(x.getTree(), xy.getParent().getTree());
+ assertEquals(rootTree, x.getParent().getTree());
}
@Test
public void testPropertyLocation() {
- TreeLocation a = TreeLocation.create(root, "/a");
- assertNotNull(a.getProperty());
+ TreeLocation propLocation = TreeLocation.create(root, "/p");
+ assertNotNull(propLocation.getProperty());
- TreeLocation abc = a.getChild("b").getChild("c");
- assertEquals("/a/b/c", abc.getPath());
+ TreeLocation abc = propLocation.getChild("b").getChild("c");
+ assertEquals("/p/b/c", abc.getPath());
assertNull(abc.getProperty());
TreeLocation ab = abc.getParent();
- assertEquals("/a/b", ab.getPath());
+ assertEquals("/p/b", ab.getPath());
assertNull(ab.getProperty());
- assertEquals(a.getProperty(), ab.getParent().getProperty());
+ assertEquals(propLocation.getProperty(), ab.getParent().getProperty());
}
@Test
public void getDeepLocation() {
- TreeLocation p = TreeLocation.create(root, "/z/1/2/p");
+ TreeLocation child = TreeLocation.create(root, "/z/child");
+ assertNotNull(child.getTree());
+ assertNull(child.getProperty());
+
+ TreeLocation p = TreeLocation.create(root, "/z/child/p");
assertNotNull(p.getProperty());
- assertEquals("/z/1/2/p", p.getPath());
+ assertNull(p.getTree());
+ assertEquals("/z/child/p", p.getPath());
- TreeLocation n = TreeLocation.create(root, "/z/1/2/3/4");
+ TreeLocation n = TreeLocation.create(root, "/z/child/p/3/4");
assertNull(n.getTree());
assertNull(n.getProperty());
- assertEquals("/z/1/2/3/4", n.getPath());
+ assertEquals("/z/child/p/3/4", n.getPath());
+
+ TreeLocation t = n.getParent().getParent();
+ assertNull(t.getTree());
+ assertNotNull(t.getProperty());
- TreeLocation two = n.getParent().getParent();
- assertNotNull(two.getTree());
- assertEquals("/z/1/2", two.getPath());
+ TreeLocation t2 = t.getParent();
+ assertNotNull(t2.getTree());
+ assertEquals("/z/child", t2.getPath());
}
-}
+}
\ No newline at end of file
Modified:
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/tree/TreeTypeProviderTest.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/tree/TreeTypeProviderTest.java?rev=1809844&r1=1809843&r2=1809844&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/tree/TreeTypeProviderTest.java
(original)
+++
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/tree/TreeTypeProviderTest.java
Wed Sep 27 12:48:33 2017
@@ -21,30 +21,54 @@ import java.util.List;
import javax.annotation.Nonnull;
import org.apache.jackrabbit.JcrConstants;
-import org.apache.jackrabbit.oak.AbstractSecurityTest;
+import org.apache.jackrabbit.oak.api.PropertyState;
import org.apache.jackrabbit.oak.api.Tree;
+import org.apache.jackrabbit.oak.commons.PathUtils;
import org.apache.jackrabbit.oak.spi.nodetype.NodeTypeConstants;
import org.apache.jackrabbit.oak.spi.version.VersionConstants;
-import
org.apache.jackrabbit.oak.spi.security.authorization.AuthorizationConfiguration;
-import
org.apache.jackrabbit.oak.spi.security.authorization.accesscontrol.AccessControlConstants;
-import
org.apache.jackrabbit.oak.spi.security.authorization.permission.PermissionConstants;
-import org.apache.jackrabbit.oak.util.NodeUtil;
+import org.junit.Before;
import org.junit.Test;
+import org.mockito.Mockito;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
+import static org.mockito.Mockito.when;
-public class TreeTypeProviderTest extends AbstractSecurityTest {
+public class TreeTypeProviderTest {
private TreeTypeProvider typeProvider;
private List<TypeTest> tests;
- @Override
+ @Before
public void before() throws Exception {
- super.before();
+ typeProvider = new TreeTypeProvider(new TreeContext(){
- typeProvider = new
TreeTypeProvider(getConfig(AuthorizationConfiguration.class).getContext());
+ @Override
+ public boolean definesProperty(@Nonnull Tree parent, @Nonnull
PropertyState property) {
+ return false;
+ }
+
+ @Override
+ public boolean definesContextRoot(@Nonnull Tree tree) {
+ return false;
+ }
+
+ @Override
+ public boolean definesTree(@Nonnull Tree tree) {
+ return false;
+ }
+
+ @Override
+ public boolean definesLocation(@Nonnull TreeLocation location) {
+ return false;
+ }
+
+ @Override
+ public boolean definesInternal(@Nonnull Tree tree) {
+ return false;
+ }
+ });
tests = new ArrayList<TypeTest>();
tests.add(new TypeTest("/", TreeType.DEFAULT));
@@ -54,12 +78,6 @@ public class TreeTypeProviderTest extend
tests.add(new TypeTest(NodeTypeConstants.NODE_TYPES_PATH +
"/rep:system/rep:namedChildNodeDefinitions/jcr:versionStorage",
TreeType.DEFAULT));
tests.add(new TypeTest(NodeTypeConstants.NODE_TYPES_PATH +
"/rep:system/rep:namedChildNodeDefinitions/jcr:activities", TreeType.DEFAULT));
tests.add(new TypeTest(NodeTypeConstants.NODE_TYPES_PATH +
"/rep:system/rep:namedChildNodeDefinitions/jcr:configurations",
TreeType.DEFAULT));
- tests.add(new TypeTest(NodeTypeConstants.NODE_TYPES_PATH +
"/rep:AccessControllable/rep:namedChildNodeDefinitions/rep:policy",
TreeType.DEFAULT));
- tests.add(new TypeTest(NodeTypeConstants.NODE_TYPES_PATH +
"/rep:AccessControllable/rep:namedChildNodeDefinitions/rep:policy/rep:Policy",
TreeType.DEFAULT));
- tests.add(new TypeTest(NodeTypeConstants.NODE_TYPES_PATH +
"/rep:ACL/rep:residualChildNodeDefinitions/rep:ACE", TreeType.DEFAULT));
- tests.add(new TypeTest(NodeTypeConstants.NODE_TYPES_PATH +
"/rep:GrantACE/rep:namedChildNodeDefinitions/rep:restrictions",
TreeType.DEFAULT));
- tests.add(new TypeTest(NodeTypeConstants.NODE_TYPES_PATH +
"/rep:RepoAccessControllable/rep:namedChildNodeDefinitions/rep:repoPolicy",
TreeType.DEFAULT));
- tests.add(new TypeTest(NodeTypeConstants.NODE_TYPES_PATH +
"/rep:PermissionStore", TreeType.DEFAULT));
tests.add(new TypeTest("/:hidden", TreeType.HIDDEN));
tests.add(new TypeTest("/:hidden/child", TreeType.HIDDEN,
TreeType.HIDDEN));
@@ -71,56 +89,41 @@ public class TreeTypeProviderTest extend
tests.add(new TypeTest(versionPath, TreeType.VERSION));
tests.add(new TypeTest(versionPath + "/a/b/child",
TreeType.VERSION, TreeType.VERSION));
}
-
- tests.add(new TypeTest(PermissionConstants.PERMISSIONS_STORE_PATH,
TreeType.INTERNAL));
- tests.add(new TypeTest(PermissionConstants.PERMISSIONS_STORE_PATH +
"/a/b/child", TreeType.INTERNAL, TreeType.INTERNAL));
-
- NodeUtil testTree = new NodeUtil(root.getTree("/")).addChild("test",
NodeTypeConstants.NT_OAK_UNSTRUCTURED);
- for (String name : AccessControlConstants.POLICY_NODE_NAMES) {
- NodeUtil acl = testTree.addChild(name,
AccessControlConstants.NT_REP_ACL);
- tests.add(new TypeTest(acl.getTree().getPath(),
TreeType.ACCESS_CONTROL));
-
- NodeUtil ace = acl.addChild("ace",
AccessControlConstants.NT_REP_DENY_ACE);
- tests.add(new TypeTest(ace.getTree().getPath(),
TreeType.ACCESS_CONTROL, TreeType.ACCESS_CONTROL));
-
- NodeUtil ace2 = acl.addChild("ace2",
AccessControlConstants.NT_REP_GRANT_ACE);
- tests.add(new TypeTest(ace2.getTree().getPath(),
TreeType.ACCESS_CONTROL, TreeType.ACCESS_CONTROL));
-
- NodeUtil rest =
ace2.addChild(AccessControlConstants.REP_RESTRICTIONS,
AccessControlConstants.NT_REP_RESTRICTIONS);
- tests.add(new TypeTest(rest.getTree().getPath(),
TreeType.ACCESS_CONTROL, TreeType.ACCESS_CONTROL));
-
- NodeUtil invalid = rest.addChild("invalid",
NodeTypeConstants.NT_OAK_UNSTRUCTURED);
- tests.add(new TypeTest(invalid.getTree().getPath(),
TreeType.ACCESS_CONTROL, TreeType.ACCESS_CONTROL));
- }
}
- @Override
- public void after() throws Exception {
- try {
- root.refresh();
- } finally {
- super.after();
+ private static Tree mockTree(@Nonnull String path) {
+ Tree t = Mockito.mock(Tree.class);
+ when(t.getPath()).thenReturn(path);
+ when(t.getName()).thenReturn(PathUtils.getName(path));
+ if (PathUtils.denotesRoot(path)) {
+ when(t.getParent()).thenThrow(IllegalStateException.class);
+ when(t.isRoot()).thenReturn(true);
+ } else {
+ Tree parent = mockTree(PathUtils.getAncestorPath(path, 1));
+ when(t.getParent()).thenReturn(parent);
+ when(t.isRoot()).thenReturn(false);
}
+ return t;
}
@Test
public void testGetType() {
for (TypeTest test : tests) {
- assertEquals(test.path, test.type,
typeProvider.getType(root.getTree(test.path)));
+ assertEquals(test.path, test.type,
typeProvider.getType(mockTree(test.path)));
}
}
@Test
public void testGetTypeWithParentType() {
for (TypeTest test : tests) {
- assertEquals(test.path, test.type,
typeProvider.getType(root.getTree(test.path), test.parentType));
+ assertEquals(test.path, test.type,
typeProvider.getType(mockTree(test.path), test.parentType));
}
}
@Test
public void testGetTypeWithDefaultParentType() {
for (TypeTest test : tests) {
- TreeType typeIfParentDefault =
typeProvider.getType(root.getTree(test.path), TreeType.DEFAULT);
+ TreeType typeIfParentDefault =
typeProvider.getType(mockTree(test.path), TreeType.DEFAULT);
if (TreeType.DEFAULT == test.parentType) {
assertEquals(test.path, test.type, typeIfParentDefault);
@@ -132,7 +135,7 @@ public class TreeTypeProviderTest extend
@Test
public void testGetTypeForRootTree() {
- Tree t = root.getTree("/");
+ Tree t = mockTree(PathUtils.ROOT_PATH);
assertEquals(TreeType.DEFAULT, typeProvider.getType(t));
// the type of the root tree is always 'DEFAULT' irrespective of the
passed parent type.
@@ -141,32 +144,6 @@ public class TreeTypeProviderTest extend
assertEquals(TreeType.DEFAULT, typeProvider.getType(t,
TreeType.VERSION));
}
- @Test
- public void testGetTypeForImmutableTree() {
- for (String path : new String[] {"/", "/testPath"}) {
- Tree t = RootFactory.createReadOnlyRoot(root).getTree(path);
- assertEquals(TreeType.DEFAULT, typeProvider.getType(t));
- // also for repeated calls
- assertEquals(TreeType.DEFAULT, typeProvider.getType(t));
-
- // the type of an immutable tree is set after the first call
irrespective of the passed parent type.
- assertEquals(TreeType.DEFAULT, typeProvider.getType(t,
TreeType.DEFAULT));
- assertEquals(TreeType.DEFAULT, typeProvider.getType(t,
TreeType.HIDDEN));
- }
- }
-
- @Test
- public void testGetTypeForImmutableTreeWithParent() {
- Tree t =
RootFactory.createReadOnlyRoot(root).getTree("/:hidden/testPath");
- assertEquals(TreeType.HIDDEN, typeProvider.getType(t,
TreeType.HIDDEN));
-
- // the type of an immutable tree is set after the first call
irrespective of the passed parent type.
- assertEquals(TreeType.HIDDEN, typeProvider.getType(t));
- assertEquals(TreeType.HIDDEN, typeProvider.getType(t,
TreeType.DEFAULT));
- assertEquals(TreeType.HIDDEN, typeProvider.getType(t,
TreeType.ACCESS_CONTROL));
- assertEquals(TreeType.HIDDEN, typeProvider.getType(t,
TreeType.VERSION));
- }
-
private static final class TypeTest {
private final String path;
Modified:
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/tree/impl/ImmutableTreeTest.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/tree/impl/ImmutableTreeTest.java?rev=1809844&r1=1809843&r2=1809844&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/tree/impl/ImmutableTreeTest.java
(original)
+++
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/tree/impl/ImmutableTreeTest.java
Wed Sep 27 12:48:33 2017
@@ -18,14 +18,7 @@
*/
package org.apache.jackrabbit.oak.plugins.tree.impl;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-
import java.util.List;
-
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@@ -36,13 +29,25 @@ import org.apache.jackrabbit.JcrConstant
import org.apache.jackrabbit.oak.AbstractSecurityTest;
import org.apache.jackrabbit.oak.api.PropertyState;
import org.apache.jackrabbit.oak.api.Tree;
-import org.apache.jackrabbit.oak.util.NodeUtil;
+import org.apache.jackrabbit.oak.plugins.tree.TreeConstants;
+import org.apache.jackrabbit.oak.plugins.tree.TreeType;
+import org.apache.jackrabbit.oak.plugins.tree.TreeTypeProvider;
import org.apache.jackrabbit.oak.plugins.tree.TreeUtil;
+import org.apache.jackrabbit.oak.plugins.tree.RootFactory;
+import
org.apache.jackrabbit.oak.spi.security.authorization.AuthorizationConfiguration;
+import org.apache.jackrabbit.oak.util.NodeUtil;
import org.apache.jackrabbit.util.Text;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+
public class ImmutableTreeTest extends AbstractSecurityTest {
private static final String HIDDEN_PATH =
"/oak:index/acPrincipalName/:index";
@@ -270,4 +275,44 @@ public class ImmutableTreeTest extends A
}));
assertEquals(Lists.newArrayList(names), actual);
}
-}
+
+ @Test
+ public void testSetType() {
+ assertNull(immutable.getType());
+
+ immutable.setType(TreeType.VERSION);
+ assertSame(TreeType.VERSION, immutable.getType());
+
+ immutable.setType(TreeType.DEFAULT);
+ assertSame(TreeType.DEFAULT, immutable.getType());
+ }
+
+ @Test
+ public void testGetTypeForImmutableTree() {
+ TreeTypeProvider typeProvider = new
TreeTypeProvider(getConfig(AuthorizationConfiguration.class).getContext());
+ for (String path : new String[] {"/", "/testPath"}) {
+ Tree t = RootFactory.createReadOnlyRoot(root).getTree(path);
+ assertEquals(TreeType.DEFAULT, typeProvider.getType(t));
+ // also for repeated calls
+ assertEquals(TreeType.DEFAULT, typeProvider.getType(t));
+
+ // the type of an immutable tree is set after the first call
irrespective of the passed parent type.
+ assertEquals(TreeType.DEFAULT, typeProvider.getType(t,
TreeType.DEFAULT));
+ assertEquals(TreeType.DEFAULT, typeProvider.getType(t,
TreeType.HIDDEN));
+ }
+ }
+
+ @Test
+ public void testGetTypeForImmutableTreeWithParent() {
+ TreeTypeProvider typeProvider = new
TreeTypeProvider(getConfig(AuthorizationConfiguration.class).getContext());
+
+ Tree t =
RootFactory.createReadOnlyRoot(root).getTree("/:hidden/testPath");
+ assertEquals(TreeType.HIDDEN, typeProvider.getType(t,
TreeType.HIDDEN));
+
+ // the type of an immutable tree is set after the first call
irrespective of the passed parent type.
+ assertEquals(TreeType.HIDDEN, typeProvider.getType(t));
+ assertEquals(TreeType.HIDDEN, typeProvider.getType(t,
TreeType.DEFAULT));
+ assertEquals(TreeType.HIDDEN, typeProvider.getType(t,
TreeType.ACCESS_CONTROL));
+ assertEquals(TreeType.HIDDEN, typeProvider.getType(t,
TreeType.VERSION));
+ }
+}
\ No newline at end of file
Modified:
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/AuthorizationContextTest.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/AuthorizationContextTest.java?rev=1809844&r1=1809843&r2=1809844&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/AuthorizationContextTest.java
(original)
+++
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/AuthorizationContextTest.java
Wed Sep 27 12:48:33 2017
@@ -16,8 +16,9 @@
*/
package org.apache.jackrabbit.oak.security.authorization;
+import java.util.ArrayList;
import java.util.List;
-
+import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.jcr.RepositoryException;
import javax.jcr.security.AccessControlList;
@@ -28,17 +29,24 @@ import com.google.common.collect.Lists;
import org.apache.jackrabbit.JcrConstants;
import
org.apache.jackrabbit.commons.jackrabbit.authorization.AccessControlUtils;
import org.apache.jackrabbit.oak.AbstractSecurityTest;
+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.plugins.tree.TreeLocation;
+import org.apache.jackrabbit.oak.plugins.tree.TreeType;
+import org.apache.jackrabbit.oak.plugins.tree.TreeTypeProvider;
+import org.apache.jackrabbit.oak.spi.nodetype.NodeTypeConstants;
import org.apache.jackrabbit.oak.spi.security.Context;
import
org.apache.jackrabbit.oak.spi.security.authorization.accesscontrol.AccessControlConstants;
import
org.apache.jackrabbit.oak.spi.security.authorization.permission.PermissionConstants;
import org.apache.jackrabbit.oak.spi.security.principal.EveryonePrincipal;
import org.apache.jackrabbit.oak.spi.security.privilege.PrivilegeConstants;
+import org.apache.jackrabbit.oak.util.NodeUtil;
import org.junit.Test;
+import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
@@ -141,4 +149,84 @@ public class AuthorizationContextTest ex
}
}
+ @Test
+ public void testGetType() throws Exception {
+ TreeTypeProvider ttp = new
TreeTypeProvider(AuthorizationContext.getInstance());
+ for (TypeTest test : TypeTest.createTests(root)) {
+ assertEquals(test.path, test.type,
ttp.getType(root.getTree(test.path)));
+ }
+ }
+
+ @Test
+ public void testGetTypeWithParentType() throws Exception {
+ TreeTypeProvider ttp = new
TreeTypeProvider(AuthorizationContext.getInstance());
+ for (TypeTest test : TypeTest.createTests(root)) {
+ assertEquals(test.path, test.type,
ttp.getType(root.getTree(test.path), test.parentType));
+ }
+ }
+
+ @Test
+ public void testGetTypeWithDefaultParentType() throws Exception {
+ TreeTypeProvider ttp = new
TreeTypeProvider(AuthorizationContext.getInstance());
+ for (TypeTest test : TypeTest.createTests(root)) {
+ TreeType typeIfParentDefault =
ttp.getType(root.getTree(test.path), TreeType.DEFAULT);
+
+ if (TreeType.DEFAULT == test.parentType) {
+ assertEquals(test.path, test.type, typeIfParentDefault);
+ } else {
+ assertNotEquals(test.path, test.type, typeIfParentDefault);
+ }
+ }
+ }
+
+
+ private static final class TypeTest {
+
+ private final String path;
+ private final TreeType type;
+ private final TreeType parentType;
+
+ private TypeTest(@Nonnull String path, TreeType type) {
+ this(path, type, TreeType.DEFAULT);
+ }
+
+ private TypeTest(@Nonnull String path, TreeType type, TreeType
parentType) {
+ this.path = path;
+ this.type = type;
+ this.parentType = parentType;
+ }
+
+ private static List<TypeTest> createTests(@Nonnull Root root) throws
Exception {
+ List<TypeTest> tests = new ArrayList();
+ tests.add(new TypeTest(NodeTypeConstants.NODE_TYPES_PATH +
"/rep:AccessControllable/rep:namedChildNodeDefinitions/rep:policy",
TreeType.DEFAULT));
+ tests.add(new TypeTest(NodeTypeConstants.NODE_TYPES_PATH +
"/rep:AccessControllable/rep:namedChildNodeDefinitions/rep:policy/rep:Policy",
TreeType.DEFAULT));
+ tests.add(new TypeTest(NodeTypeConstants.NODE_TYPES_PATH +
"/rep:ACL/rep:residualChildNodeDefinitions/rep:ACE", TreeType.DEFAULT));
+ tests.add(new TypeTest(NodeTypeConstants.NODE_TYPES_PATH +
"/rep:GrantACE/rep:namedChildNodeDefinitions/rep:restrictions",
TreeType.DEFAULT));
+ tests.add(new TypeTest(NodeTypeConstants.NODE_TYPES_PATH +
"/rep:RepoAccessControllable/rep:namedChildNodeDefinitions/rep:repoPolicy",
TreeType.DEFAULT));
+ tests.add(new TypeTest(NodeTypeConstants.NODE_TYPES_PATH +
"/rep:PermissionStore", TreeType.DEFAULT));
+
+
+ tests.add(new TypeTest(PermissionConstants.PERMISSIONS_STORE_PATH,
TreeType.INTERNAL));
+ tests.add(new TypeTest(PermissionConstants.PERMISSIONS_STORE_PATH
+ "/a/b/child", TreeType.INTERNAL, TreeType.INTERNAL));
+
+ NodeUtil testTree = new
NodeUtil(root.getTree("/")).addChild("test",
NodeTypeConstants.NT_OAK_UNSTRUCTURED);
+ for (String name : AccessControlConstants.POLICY_NODE_NAMES) {
+ NodeUtil acl = testTree.addChild(name,
AccessControlConstants.NT_REP_ACL);
+ tests.add(new TypeTest(acl.getTree().getPath(),
TreeType.ACCESS_CONTROL));
+
+ NodeUtil ace = acl.addChild("ace",
AccessControlConstants.NT_REP_DENY_ACE);
+ tests.add(new TypeTest(ace.getTree().getPath(),
TreeType.ACCESS_CONTROL, TreeType.ACCESS_CONTROL));
+
+ NodeUtil ace2 = acl.addChild("ace2",
AccessControlConstants.NT_REP_GRANT_ACE);
+ tests.add(new TypeTest(ace2.getTree().getPath(),
TreeType.ACCESS_CONTROL, TreeType.ACCESS_CONTROL));
+
+ NodeUtil rest =
ace2.addChild(AccessControlConstants.REP_RESTRICTIONS,
AccessControlConstants.NT_REP_RESTRICTIONS);
+ tests.add(new TypeTest(rest.getTree().getPath(),
TreeType.ACCESS_CONTROL, TreeType.ACCESS_CONTROL));
+
+ NodeUtil invalid = rest.addChild("invalid",
NodeTypeConstants.NT_OAK_UNSTRUCTURED);
+ tests.add(new TypeTest(invalid.getTree().getPath(),
TreeType.ACCESS_CONTROL, TreeType.ACCESS_CONTROL));
+ }
+ return tests;
+ }
+ }
}
\ No newline at end of file
Modified:
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/ChildOrderPropertyTest.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/ChildOrderPropertyTest.java?rev=1809844&r1=1809843&r2=1809844&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/ChildOrderPropertyTest.java
(original)
+++
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/ChildOrderPropertyTest.java
Wed Sep 27 12:48:33 2017
@@ -34,13 +34,13 @@ import org.apache.jackrabbit.JcrConstant
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.plugins.tree.impl.TreeConstants;
+import org.apache.jackrabbit.oak.plugins.tree.TreeConstants;
import org.apache.jackrabbit.oak.spi.security.privilege.PrivilegeConstants;
import org.junit.Before;
import org.junit.Test;
/**
- * Test for the hidden {@link
org.apache.jackrabbit.oak.plugins.tree.impl.TreeConstants#OAK_CHILD_ORDER}
property
+ * Test for the hidden {@link TreeConstants#OAK_CHILD_ORDER} property
*/
public class ChildOrderPropertyTest extends AbstractOakCoreTest {
Modified:
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/HiddenPropertyTest.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/HiddenPropertyTest.java?rev=1809844&r1=1809843&r2=1809844&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/HiddenPropertyTest.java
(original)
+++
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/HiddenPropertyTest.java
Wed Sep 27 12:48:33 2017
@@ -23,7 +23,7 @@ import org.apache.jackrabbit.JcrConstant
import org.apache.jackrabbit.oak.api.PropertyState;
import org.apache.jackrabbit.oak.api.Tree;
import org.apache.jackrabbit.oak.plugins.memory.PropertyBuilder;
-import org.apache.jackrabbit.oak.plugins.tree.impl.TreeConstants;
+import org.apache.jackrabbit.oak.plugins.tree.TreeConstants;
import org.junit.Before;
import org.junit.Test;
@@ -36,7 +36,7 @@ import static org.junit.Assert.assertTru
import static org.junit.Assert.fail;
/**
- * Test for the hidden {@link
org.apache.jackrabbit.oak.plugins.tree.impl.TreeConstants#OAK_CHILD_ORDER}
property
+ * Test for the hidden {@link TreeConstants#OAK_CHILD_ORDER} property
*/
public class HiddenPropertyTest extends AbstractOakCoreTest {
Modified:
jackrabbit/oak/trunk/oak-it/src/test/java/org/apache/jackrabbit/oak/core/MutableTreeTest.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-it/src/test/java/org/apache/jackrabbit/oak/core/MutableTreeTest.java?rev=1809844&r1=1809843&r2=1809844&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-it/src/test/java/org/apache/jackrabbit/oak/core/MutableTreeTest.java
(original)
+++
jackrabbit/oak/trunk/oak-it/src/test/java/org/apache/jackrabbit/oak/core/MutableTreeTest.java
Wed Sep 27 12:48:33 2017
@@ -43,7 +43,7 @@ import org.apache.jackrabbit.oak.fixture
import org.apache.jackrabbit.oak.api.Type;
import org.apache.jackrabbit.oak.plugins.memory.LongPropertyState;
import org.apache.jackrabbit.oak.plugins.memory.StringBasedBlob;
-import org.apache.jackrabbit.oak.plugins.tree.impl.TreeConstants;
+import org.apache.jackrabbit.oak.plugins.tree.TreeConstants;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
Modified:
jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/version/HiddenNodeTest.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/version/HiddenNodeTest.java?rev=1809844&r1=1809843&r2=1809844&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/version/HiddenNodeTest.java
(original)
+++
jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/version/HiddenNodeTest.java
Wed Sep 27 12:48:33 2017
@@ -29,7 +29,7 @@ import javax.jcr.version.VersionManager;
import org.apache.jackrabbit.oak.commons.PathUtils;
import org.apache.jackrabbit.oak.jcr.Jcr;
-import org.apache.jackrabbit.oak.plugins.tree.impl.TreeConstants;
+import org.apache.jackrabbit.oak.plugins.tree.TreeConstants;
import org.apache.jackrabbit.oak.spi.version.VersionConstants;
import org.apache.jackrabbit.oak.segment.SegmentNodeStoreBuilders;
import org.apache.jackrabbit.oak.segment.memory.MemoryStore;
Modified:
jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/IndexDefinition.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/IndexDefinition.java?rev=1809844&r1=1809843&r2=1809844&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/IndexDefinition.java
(original)
+++
jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/IndexDefinition.java
Wed Sep 27 12:48:33 2017
@@ -101,7 +101,7 @@ import static org.apache.jackrabbit.oak.
public final class IndexDefinition implements Aggregate.AggregateMapper {
/**
* Name of the internal property that contains the child order defined in
- * org.apache.jackrabbit.oak.plugins.tree.impl.TreeConstants
+ * org.apache.jackrabbit.oak.plugins.tree.TreeConstants
*/
private static final String OAK_CHILD_ORDER = ":childOrder";
Modified:
jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/IndexDefinitionTest.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/IndexDefinitionTest.java?rev=1809844&r1=1809843&r2=1809844&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/IndexDefinitionTest.java
(original)
+++
jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/IndexDefinitionTest.java
Wed Sep 27 12:48:33 2017
@@ -62,7 +62,7 @@ import static org.apache.jackrabbit.oak.
import static
org.apache.jackrabbit.oak.plugins.memory.EmptyNodeState.EMPTY_NODE;
import static
org.apache.jackrabbit.oak.plugins.memory.PropertyStates.createProperty;
import static org.apache.jackrabbit.oak.InitialContent.INITIAL_CONTENT;
-import static
org.apache.jackrabbit.oak.plugins.tree.impl.TreeConstants.OAK_CHILD_ORDER;
+import static
org.apache.jackrabbit.oak.plugins.tree.TreeConstants.OAK_CHILD_ORDER;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
Modified:
jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/NodeStateAnalyzerFactoryTest.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/NodeStateAnalyzerFactoryTest.java?rev=1809844&r1=1809843&r2=1809844&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/NodeStateAnalyzerFactoryTest.java
(original)
+++
jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/NodeStateAnalyzerFactoryTest.java
Wed Sep 27 12:48:33 2017
@@ -55,7 +55,7 @@ import static org.apache.jackrabbit.oak.
import static
org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexConstants.ANL_FILTERS;
import static
org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexConstants.ANL_TOKENIZER;
import static
org.apache.jackrabbit.oak.plugins.memory.EmptyNodeState.EMPTY_NODE;
-import static
org.apache.jackrabbit.oak.plugins.tree.impl.TreeConstants.OAK_CHILD_ORDER;
+import static
org.apache.jackrabbit.oak.plugins.tree.TreeConstants.OAK_CHILD_ORDER;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
Modified:
jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/JackrabbitNodeState.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/JackrabbitNodeState.java?rev=1809844&r1=1809843&r2=1809844&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/JackrabbitNodeState.java
(original)
+++
jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/JackrabbitNodeState.java
Wed Sep 27 12:48:33 2017
@@ -43,7 +43,7 @@ import static org.apache.jackrabbit.core
import static org.apache.jackrabbit.oak.api.Type.NAME;
import static org.apache.jackrabbit.oak.api.Type.NAMES;
import static org.apache.jackrabbit.oak.api.Type.STRING;
-import static
org.apache.jackrabbit.oak.plugins.tree.impl.TreeConstants.OAK_CHILD_ORDER;
+import static
org.apache.jackrabbit.oak.plugins.tree.TreeConstants.OAK_CHILD_ORDER;
import java.io.ByteArrayInputStream;
import java.io.IOException;