jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1477545 - in /jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak: api/ core/
Date Tue, 30 Apr 2013 10:44:34 GMT
Author: mduerig
Date: Tue Apr 30 10:44:32 2013
New Revision: 1477545

URL: http://svn.apache.org/r1477545
Log:
OAK-798: Review / refactor TreeImpl and related classes
Replace usages of Root.getTreeOrNull with Root.getTree
Replace usages of Tree.getChildOrNull with Tree.getChild

Modified:
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/api/ContentSessionTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/api/QueryTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/api/RootTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/api/TreeTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/api/UniquePropertyTest.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-core/src/test/java/org/apache/jackrabbit/oak/core/LargeMoveTestIT.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
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/TreeImplTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/TreeLocationTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/api/ContentSessionTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/api/ContentSessionTest.java?rev=1477545&r1=1477544&r2=1477545&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/api/ContentSessionTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/api/ContentSessionTest.java Tue Apr 30 10:44:32 2013
@@ -54,15 +54,15 @@ public class ContentSessionTest extends 
         ContentSession session = repository.login(null, null);
         Root root = session.getLatestRoot();
         session.close();
-        root.getTreeOrNull("/");
+        root.getTree("/");
     }
 
     @Test(expected = IllegalStateException.class)
     public void throwOnClosedTree() throws LoginException, NoSuchWorkspaceException, IOException {
         ContentSession session = repository.login(null, null);
         Root root = session.getLatestRoot();
-        Tree tree = root.getTreeOrNull("/");
+        Tree tree = root.getTree("/");
         session.close();
-        tree.getChildOrNull("any");
+        tree.getChild("any");
     }
 }

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/api/QueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/api/QueryTest.java?rev=1477545&r1=1477544&r2=1477545&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/api/QueryTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/api/QueryTest.java Tue Apr 30 10:44:32 2013
@@ -18,6 +18,8 @@
  */
 package org.apache.jackrabbit.oak.api;
 
+import static junit.framework.Assert.assertEquals;
+
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashSet;
@@ -33,8 +35,6 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
-import static junit.framework.Assert.assertEquals;
-
 /**
  * {@code QueryTest} contains query related tests.
  */
@@ -56,7 +56,7 @@ public class QueryTest {
     public void queryOnStableRevision() throws Exception {
         ContentSession s = repository.login(null, null);
         Root r = s.getLatestRoot();
-        Tree t = r.getTreeOrNull("/").addChild("test");
+        Tree t = r.getTree("/").addChild("test");
         t.addChild("node1").setProperty("jcr:primaryType", "nt:base");
         t.addChild("node2").setProperty("jcr:primaryType", "nt:base");
         t.addChild("node3").setProperty("jcr:primaryType", "nt:base");
@@ -65,7 +65,7 @@ public class QueryTest {
         ContentSession s2 = repository.login(null, null);
         Root r2 = s2.getLatestRoot();
 
-        r.getTreeOrNull("/test").getChildOrNull("node2").remove();
+        r.getTree("/test").getChild("node2").remove();
         r.commit();
 
         Result result = r2.getQueryEngine().executeQuery(

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/api/RootTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/api/RootTest.java?rev=1477545&r1=1477544&r2=1477545&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/api/RootTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/api/RootTest.java Tue Apr 30 10:44:32 2013
@@ -18,6 +18,8 @@
  */
 package org.apache.jackrabbit.oak.api;
 
+import static org.apache.jackrabbit.oak.OakAssert.assertSequence;
+
 import org.apache.jackrabbit.oak.Oak;
 import org.apache.jackrabbit.oak.plugins.commit.ConflictValidator;
 import org.apache.jackrabbit.oak.plugins.commit.JcrConflictHandler;
@@ -26,8 +28,6 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
-import static org.apache.jackrabbit.oak.OakAssert.assertSequence;
-
 /**
  * Contains tests related to {@link Root}
  */
@@ -54,7 +54,7 @@ public class RootTest {
         ContentSession s = repository.login(null, null);
         try {
             Root r = s.getLatestRoot();
-            Tree t = r.getTreeOrNull("/");
+            Tree t = r.getTree("/");
             Tree c = t.addChild("c");
             c.addChild("node1").orderBefore(null);
             c.addChild("node2");
@@ -75,7 +75,7 @@ public class RootTest {
         ContentSession s = repository.login(null, null);
         try {
             Root r = s.getLatestRoot();
-            Tree t = r.getTreeOrNull("/");
+            Tree t = r.getTree("/");
             Tree c = t.addChild("c");
             c.addChild("node1").orderBefore(null);
             c.addChild("node2");

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/api/TreeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/api/TreeTest.java?rev=1477545&r1=1477544&r2=1477545&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/api/TreeTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/api/TreeTest.java Tue Apr 30 10:44:32 2013
@@ -18,6 +18,11 @@
  */
 package org.apache.jackrabbit.oak.api;
 
+import static org.apache.jackrabbit.oak.OakAssert.assertSequence;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
 import java.util.Set;
 
 import com.google.common.collect.Sets;
@@ -32,11 +37,6 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
-import static org.apache.jackrabbit.oak.OakAssert.assertSequence;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
 /**
  * Contains tests related to {@link Tree}
  */
@@ -75,25 +75,25 @@ public class TreeTest {
         ContentSession s = repository.login(null, null);
         try {
             Root r = s.getLatestRoot();
-            Tree t = r.getTreeOrNull("/");
+            Tree t = r.getTree("/");
             t.addChild("node1");
             t.addChild("node2");
             t.addChild("node3");
             r.commit();
 
-            t.getChildOrNull("node1").orderBefore("node2");
-            t.getChildOrNull("node3").orderBefore(null);
+            t.getChild("node1").orderBefore("node2");
+            t.getChild("node3").orderBefore(null);
             assertSequence(t.getChildren(), "node1", "node2", "node3");
             r.commit();
             // check again after commit
             assertSequence(t.getChildren(), "node1", "node2", "node3");
 
-            t.getChildOrNull("node3").orderBefore("node2");
+            t.getChild("node3").orderBefore("node2");
             assertSequence(t.getChildren(), "node1", "node3", "node2");
             r.commit();
             assertSequence(t.getChildren(), "node1", "node3", "node2");
 
-            t.getChildOrNull("node1").orderBefore(null);
+            t.getChild("node1").orderBefore(null);
             assertSequence(t.getChildren(), "node3", "node2", "node1");
             r.commit();
             assertSequence(t.getChildren(), "node3", "node2", "node1");
@@ -111,7 +111,7 @@ public class TreeTest {
         ContentSession s1 = repository.login(null, null);
         try {
             Root r1 = s1.getLatestRoot();
-            Tree t1 = r1.getTreeOrNull("/");
+            Tree t1 = r1.getTree("/");
             t1.addChild("node1");
             t1.addChild("node2");
             t1.addChild("node3");
@@ -120,22 +120,22 @@ public class TreeTest {
             ContentSession s2 = repository.login(null, null);
             try {
                 Root r2 = s2.getLatestRoot();
-                Tree t2 = r2.getTreeOrNull("/");
+                Tree t2 = r2.getTree("/");
 
-                t1.getChildOrNull("node2").orderBefore("node1");
-                t1.getChildOrNull("node3").orderBefore(null);
+                t1.getChild("node2").orderBefore("node1");
+                t1.getChild("node3").orderBefore(null);
                 r1.commit();
                 assertSequence(t1.getChildren(), "node2", "node1", "node3");
 
-                t2.getChildOrNull("node3").orderBefore("node1");
-                t2.getChildOrNull("node2").orderBefore(null);
+                t2.getChild("node3").orderBefore("node1");
+                t2.getChild("node2").orderBefore(null);
                 r2.commit();
                 // other session wins
                 assertSequence(t2.getChildren(), "node2", "node1", "node3");
 
                 // try again on current root
-                t2.getChildOrNull("node3").orderBefore("node1");
-                t2.getChildOrNull("node2").orderBefore(null);
+                t2.getChild("node3").orderBefore("node1");
+                t2.getChild("node2").orderBefore(null);
                 r2.commit();
                 assertSequence(t2.getChildren(), "node3", "node1", "node2");
 
@@ -152,7 +152,7 @@ public class TreeTest {
         ContentSession s1 = repository.login(null, null);
         try {
             Root r1 = s1.getLatestRoot();
-            Tree t1 = r1.getTreeOrNull("/");
+            Tree t1 = r1.getTree("/");
             t1.addChild("node1");
             t1.addChild("node2");
             t1.addChild("node3");
@@ -161,21 +161,21 @@ public class TreeTest {
             ContentSession s2 = repository.login(null, null);
             try {
                 Root r2 = s2.getLatestRoot();
-                Tree t2 = r2.getTreeOrNull("/");
+                Tree t2 = r2.getTree("/");
 
-                t1.getChildOrNull("node2").orderBefore("node1");
-                t1.getChildOrNull("node3").orderBefore(null);
+                t1.getChild("node2").orderBefore("node1");
+                t1.getChild("node3").orderBefore(null);
                 t1.addChild("node4");
                 r1.commit();
                 assertSequence(t1.getChildren(), "node2", "node1", "node3", "node4");
 
-                t2.getChildOrNull("node3").orderBefore("node1");
+                t2.getChild("node3").orderBefore("node1");
                 r2.commit();
                 // other session wins
                 assertSequence(t2.getChildren(), "node2", "node1", "node3", "node4");
 
                 // try again on current root
-                t2.getChildOrNull("node3").orderBefore("node1");
+                t2.getChild("node3").orderBefore("node1");
                 r2.commit();
                 assertSequence(t2.getChildren(), "node2", "node3", "node1", "node4");
 
@@ -192,7 +192,7 @@ public class TreeTest {
         ContentSession s1 = repository.login(null, null);
         try {
             Root r1 = s1.getLatestRoot();
-            Tree t1 = r1.getTreeOrNull("/");
+            Tree t1 = r1.getTree("/");
             t1.addChild("node1");
             t1.addChild("node2");
             t1.addChild("node3");
@@ -202,21 +202,21 @@ public class TreeTest {
             ContentSession s2 = repository.login(null, null);
             try {
                 Root r2 = s2.getLatestRoot();
-                Tree t2 = r2.getTreeOrNull("/");
+                Tree t2 = r2.getTree("/");
 
-                t1.getChildOrNull("node2").orderBefore("node1");
-                t1.getChildOrNull("node3").orderBefore(null);
-                t1.getChildOrNull("node4").remove();
+                t1.getChild("node2").orderBefore("node1");
+                t1.getChild("node3").orderBefore(null);
+                t1.getChild("node4").remove();
                 r1.commit();
                 assertSequence(t1.getChildren(), "node2", "node1", "node3");
 
-                t2.getChildOrNull("node3").orderBefore("node1");
+                t2.getChild("node3").orderBefore("node1");
                 r2.commit();
                 // other session wins
                 assertSequence(t2.getChildren(), "node2", "node1", "node3");
 
                 // try again on current root
-                t2.getChildOrNull("node3").orderBefore("node1");
+                t2.getChild("node3").orderBefore("node1");
                 r2.commit();
                 assertSequence(t2.getChildren(), "node2", "node3", "node1");
 
@@ -233,7 +233,7 @@ public class TreeTest {
         ContentSession s1 = repository.login(null, null);
         try {
             Root r1 = s1.getLatestRoot();
-            Tree t1 = r1.getTreeOrNull("/");
+            Tree t1 = r1.getTree("/");
             t1.addChild("node1").orderBefore(null);
             t1.addChild("node2");
             t1.addChild("node3");
@@ -243,21 +243,21 @@ public class TreeTest {
             ContentSession s2 = repository.login(null, null);
             try {
                 Root r2 = s2.getLatestRoot();
-                Tree t2 = r2.getTreeOrNull("/");
+                Tree t2 = r2.getTree("/");
 
-                t1.getChildOrNull("node2").orderBefore("node1");
-                t1.getChildOrNull("node3").orderBefore(null);
+                t1.getChild("node2").orderBefore("node1");
+                t1.getChild("node3").orderBefore(null);
                 r1.commit();
                 assertSequence(t1.getChildren(), "node2", "node1", "node4", "node3");
 
-                t2.getChildOrNull("node3").orderBefore("node1");
-                t2.getChildOrNull("node4").remove();
+                t2.getChild("node3").orderBefore("node1");
+                t2.getChild("node4").remove();
                 r2.commit();
                 // other session wins wrt ordering, but node4 is gone
                 assertSequence(t2.getChildren(), "node2", "node1", "node3");
 
                 // try reorder again on current root
-                t2.getChildOrNull("node3").orderBefore("node1");
+                t2.getChild("node3").orderBefore("node1");
                 r2.commit();
                 assertSequence(t2.getChildren(), "node2", "node3", "node1");
 
@@ -274,7 +274,7 @@ public class TreeTest {
         ContentSession s1 = repository.login(null, null);
         try {
             Root r1 = s1.getLatestRoot();
-            Tree t1 = r1.getTreeOrNull("/");
+            Tree t1 = r1.getTree("/");
             t1.addChild("node1");
             t1.addChild("node2");
             t1.addChild("node3");
@@ -283,14 +283,14 @@ public class TreeTest {
             ContentSession s2 = repository.login(null, null);
             try {
                 Root r2 = s2.getLatestRoot();
-                Tree t2 = r2.getTreeOrNull("/");
+                Tree t2 = r2.getTree("/");
 
-                t1.getChildOrNull("node2").orderBefore("node1");
-                t1.getChildOrNull("node3").remove();
+                t1.getChild("node2").orderBefore("node1");
+                t1.getChild("node3").remove();
                 r1.commit();
                 assertSequence(t1.getChildren(), "node2", "node1");
 
-                t2.getChildOrNull("node3").orderBefore("node1");
+                t2.getChild("node3").orderBefore("node1");
                 r2.commit();
                 assertSequence(t2.getChildren(), "node2", "node1");
 
@@ -307,7 +307,7 @@ public class TreeTest {
         ContentSession s1 = repository.login(null, null);
         try {
             Root r1 = s1.getLatestRoot();
-            Tree t1 = r1.getTreeOrNull("/").addChild("c");
+            Tree t1 = r1.getTree("/").addChild("c");
             t1.addChild("node1").orderBefore(null);
             t1.addChild("node2");
             t1.addChild("node3");
@@ -316,15 +316,15 @@ public class TreeTest {
             ContentSession s2 = repository.login(null, null);
             try {
                 Root r2 = s2.getLatestRoot();
-                Tree t2 = r2.getTreeOrNull("/c");
+                Tree t2 = r2.getTree("/c");
 
                 t1.remove();
                 // now 'c' does not have ordered children anymore
-                r1.getTreeOrNull("/").addChild("c");
+                r1.getTree("/").addChild("c");
                 r1.commit();
                 assertSequence(t1.getChildren());
 
-                t2.getChildOrNull("node3").orderBefore("node1");
+                t2.getChild("node3").orderBefore("node1");
                 r2.commit();
                 assertSequence(t2.getChildren());
 
@@ -341,7 +341,7 @@ public class TreeTest {
         ContentSession s1 = repository.login(null, null);
         try {
             Root r1 = s1.getLatestRoot();
-            Tree t1 = r1.getTreeOrNull("/");
+            Tree t1 = r1.getTree("/");
             t1.addChild("node1").orderBefore(null);
             t1.addChild("node2");
             t1.addChild("node3");
@@ -351,14 +351,14 @@ public class TreeTest {
             ContentSession s2 = repository.login(null, null);
             try {
                 Root r2 = s2.getLatestRoot();
-                Tree t2 = r2.getTreeOrNull("/");
+                Tree t2 = r2.getTree("/");
 
-                t1.getChildOrNull("node2").orderBefore("node1");
-                t1.getChildOrNull("node3").remove();
+                t1.getChild("node2").orderBefore("node1");
+                t1.getChild("node3").remove();
                 r1.commit();
                 assertSequence(t1.getChildren(), "node2", "node1", "node4");
 
-                t2.getChildOrNull("node4").orderBefore("node3");
+                t2.getChild("node4").orderBefore("node3");
                 r2.commit();
                 assertSequence(t2.getChildren(), "node2", "node1", "node4");
 
@@ -375,16 +375,16 @@ public class TreeTest {
         ContentSession s1 = repository.login(null, null);
         try {
             Root r1 = s1.getLatestRoot();
-            Tree t1 = r1.getTreeOrNull("/");
+            Tree t1 = r1.getTree("/");
             t1.addChild("node1").orderBefore(null);
             t1.addChild("node2");
             r1.commit();
             ContentSession s2 = repository.login(null, null);
             try {
                 Root r2 = s2.getLatestRoot();
-                Tree t2 = r2.getTreeOrNull("/");
+                Tree t2 = r2.getTree("/");
 
-                t1 = r1.getTreeOrNull("/");
+                t1 = r1.getTree("/");
                 // node3 from s1
                 t1.addChild("node3");
                 r1.commit();
@@ -393,7 +393,7 @@ public class TreeTest {
                 t2.addChild("node4");
                 r2.commit();
 
-                t1 = s1.getLatestRoot().getTreeOrNull("/");
+                t1 = s1.getLatestRoot().getTree("/");
                 assertSequence(
                         t1.getChildren(), "node1", "node2", "node3", "node4");
             } finally {
@@ -410,7 +410,7 @@ public class TreeTest {
         ContentSession s1 = repository.login(null, null);
         try {
             Root r1 = s1.getLatestRoot();
-            Tree t1 = r1.getTreeOrNull("/");
+            Tree t1 = r1.getTree("/");
             t1.addChild("node1");
             t1.addChild("node2");
             t1.addChild("node3");
@@ -418,9 +418,9 @@ public class TreeTest {
             ContentSession s2 = repository.login(null, null);
             try {
                 Root r2 = s2.getLatestRoot();
-                Tree t2 = r2.getTreeOrNull("/");
+                Tree t2 = r2.getTree("/");
 
-                t1 = r1.getTreeOrNull("/");
+                t1 = r1.getTree("/");
                 // node4 from s1
                 t1.addChild("node4");
                 r1.commit();
@@ -430,7 +430,7 @@ public class TreeTest {
                 r2.commit();
 
                 r1 = s1.getLatestRoot();
-                t1 = r1.getTreeOrNull("/");
+                t1 = r1.getTree("/");
                 Set<String> names = Sets.newHashSet();
                 for (Tree t : t1.getChildren()) {
                     names.add(t.getName());
@@ -449,23 +449,23 @@ public class TreeTest {
         ContentSession s1 = repository.login(null, null);
         try {
             Root r1 = s1.getLatestRoot();
-            Tree t1 = r1.getTreeOrNull("/").addChild("c");
+            Tree t1 = r1.getTree("/").addChild("c");
             t1.addChild("node1").orderBefore(null);
             t1.addChild("node2");
             r1.commit();
             ContentSession s2 = repository.login(null, null);
             try {
                 Root r2 = s2.getLatestRoot();
-                Tree t2 = r2.getTreeOrNull("/c");
+                Tree t2 = r2.getTree("/c");
 
-                t1 = r1.getTreeOrNull("/c");
-                t1.getChildOrNull("node2").orderBefore("node1");
+                t1 = r1.getTree("/c");
+                t1.getChild("node2").orderBefore("node1");
                 r1.commit();
                 assertSequence(t1.getChildren(), "node2", "node1");
 
                 t2.remove();
                 r2.commit();
-                assertFalse(r2.getTreeOrNull("/").hasChild("c"));
+                assertFalse(r2.getTree("/").hasChild("c"));
 
             } finally {
                 s2.close();

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/api/UniquePropertyTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/api/UniquePropertyTest.java?rev=1477545&r1=1477544&r2=1477545&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/api/UniquePropertyTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/api/UniquePropertyTest.java Tue Apr 30 10:44:32 2013
@@ -16,6 +16,8 @@
  */
 package org.apache.jackrabbit.oak.api;
 
+import static org.junit.Assert.fail;
+
 import java.util.UUID;
 
 import org.apache.jackrabbit.JcrConstants;
@@ -26,8 +28,6 @@ import org.apache.jackrabbit.oak.spi.sec
 import org.apache.jackrabbit.oak.util.NodeUtil;
 import org.junit.Test;
 
-import static org.junit.Assert.fail;
-
 /**
  * UniquePropertyTest...
  */
@@ -41,12 +41,12 @@ public class UniquePropertyTest {
                 .with(new PropertyIndexEditorProvider())
                 .with(new InitialContent()).createRoot();
 
-        NodeUtil node = new NodeUtil(root.getTreeOrNull("/"));
+        NodeUtil node = new NodeUtil(root.getTree("/"));
         String uuid =  UUID.randomUUID().toString();
         node.setString(JcrConstants.JCR_UUID, uuid);
         root.commit();
 
-        NodeUtil child = new NodeUtil(root.getTreeOrNull("/")).addChild("another", "rep:User");
+        NodeUtil child = new NodeUtil(root.getTree("/")).addChild("another", "rep:User");
         child.setString(JcrConstants.JCR_UUID, uuid);
         try {
             root.commit();

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=1477545&r1=1477544&r2=1477545&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 Tue Apr 30 10:44:32 2013
@@ -18,6 +18,13 @@
  */
 package org.apache.jackrabbit.oak.core;
 
+import static org.apache.jackrabbit.oak.api.Type.STRING;
+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.assertTrue;
+
 import org.apache.jackrabbit.oak.Oak;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.api.ContentSession;
@@ -30,11 +37,6 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
-import static org.apache.jackrabbit.oak.api.Type.STRING;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-
 public class DefaultConflictHandlerOursTest {
 
     private static final String OUR_VALUE = "our value";
@@ -52,7 +54,7 @@ public class DefaultConflictHandlerOursT
 
         // Add test content
         Root root = session.getLatestRoot();
-        Tree tree = root.getTreeOrNull("/");
+        Tree tree = root.getTree("/");
         tree.setProperty("a", 1);
         tree.setProperty("b", 2);
         tree.setProperty("c", 3);
@@ -73,97 +75,97 @@ public class DefaultConflictHandlerOursT
 
     @Test
     public void testAddExistingProperties() throws CommitFailedException {
-        theirRoot.getTreeOrNull("/").setProperty("p", THEIR_VALUE);
-        theirRoot.getTreeOrNull("/").setProperty("q", THEIR_VALUE);
-        ourRoot.getTreeOrNull("/").setProperty("p", OUR_VALUE);
-        ourRoot.getTreeOrNull("/").setProperty("q", OUR_VALUE);
+        theirRoot.getTree("/").setProperty("p", THEIR_VALUE);
+        theirRoot.getTree("/").setProperty("q", THEIR_VALUE);
+        ourRoot.getTree("/").setProperty("p", OUR_VALUE);
+        ourRoot.getTree("/").setProperty("q", OUR_VALUE);
 
         theirRoot.commit();
         ourRoot.commit();
 
-        PropertyState p = ourRoot.getTreeOrNull("/").getProperty("p");
+        PropertyState p = ourRoot.getTree("/").getProperty("p");
         assertNotNull(p);
         assertEquals(OUR_VALUE, p.getValue(STRING));
 
-        PropertyState q = ourRoot.getTreeOrNull("/").getProperty("q");
+        PropertyState q = ourRoot.getTree("/").getProperty("q");
         assertNotNull(q);
         assertEquals(OUR_VALUE, p.getValue(STRING));
     }
 
     @Test
     public void testChangeDeletedProperty() throws CommitFailedException {
-        theirRoot.getTreeOrNull("/").removeProperty("a");
-        ourRoot.getTreeOrNull("/").setProperty("a", OUR_VALUE);
+        theirRoot.getTree("/").removeProperty("a");
+        ourRoot.getTree("/").setProperty("a", OUR_VALUE);
 
         theirRoot.commit();
         ourRoot.commit();
 
-        PropertyState p = ourRoot.getTreeOrNull("/").getProperty("a");
+        PropertyState p = ourRoot.getTree("/").getProperty("a");
         assertNotNull(p);
         assertEquals(OUR_VALUE, p.getValue(STRING));
     }
 
     @Test
     public void testChangeChangedProperty() throws CommitFailedException {
-        theirRoot.getTreeOrNull("/").setProperty("a", THEIR_VALUE);
-        ourRoot.getTreeOrNull("/").setProperty("a", OUR_VALUE);
+        theirRoot.getTree("/").setProperty("a", THEIR_VALUE);
+        ourRoot.getTree("/").setProperty("a", OUR_VALUE);
 
         theirRoot.commit();
         ourRoot.commit();
 
-        PropertyState p = ourRoot.getTreeOrNull("/").getProperty("a");
+        PropertyState p = ourRoot.getTree("/").getProperty("a");
         assertNotNull(p);
         assertEquals(OUR_VALUE, p.getValue(STRING));
     }
 
     @Test
     public void testDeleteChangedProperty() throws CommitFailedException {
-        theirRoot.getTreeOrNull("/").setProperty("a", THEIR_VALUE);
-        ourRoot.getTreeOrNull("/").removeProperty("a");
+        theirRoot.getTree("/").setProperty("a", THEIR_VALUE);
+        ourRoot.getTree("/").removeProperty("a");
 
         theirRoot.commit();
         ourRoot.commit();
 
-        PropertyState p = ourRoot.getTreeOrNull("/").getProperty("a");
+        PropertyState p = ourRoot.getTree("/").getProperty("a");
         assertNull(p);
     }
 
     @Test
     public void testAddExistingNode() throws CommitFailedException {
-        theirRoot.getTreeOrNull("/").addChild("n").setProperty("p", THEIR_VALUE);
-        ourRoot.getTreeOrNull("/").addChild("n").setProperty("p", OUR_VALUE);
+        theirRoot.getTree("/").addChild("n").setProperty("p", THEIR_VALUE);
+        ourRoot.getTree("/").addChild("n").setProperty("p", OUR_VALUE);
 
         theirRoot.commit();
         ourRoot.commit();
 
-        Tree n = ourRoot.getTreeOrNull("/n");
-        assertNotNull(n);
+        Tree n = ourRoot.getTree("/n");
+        assertTrue(n.exists());
         assertEquals(OUR_VALUE, n.getProperty("p").getValue(STRING));
     }
 
     @Test
     public void testChangeDeletedNode() throws CommitFailedException {
-        theirRoot.getTreeOrNull("/x").remove();
-        ourRoot.getTreeOrNull("/x").setProperty("p", OUR_VALUE);
+        theirRoot.getTree("/x").remove();
+        ourRoot.getTree("/x").setProperty("p", OUR_VALUE);
 
         theirRoot.commit();
         ourRoot.commit();
 
-        Tree n = ourRoot.getTreeOrNull("/x");
-        assertNotNull(n);
+        Tree n = ourRoot.getTree("/x");
+        assertTrue(n.exists());
         assertEquals(OUR_VALUE, n.getProperty("p").getValue(STRING));
     }
 
     @Test
     public void testDeleteChangedNode() throws CommitFailedException {
-        theirRoot.getTreeOrNull("/x").setProperty("p", THEIR_VALUE);
-        ourRoot.getTreeOrNull("/x").remove();
+        theirRoot.getTree("/x").setProperty("p", THEIR_VALUE);
+        ourRoot.getTree("/x").remove();
 
         theirRoot.commit();
         ourRoot.commit();
 
-        Tree n = ourRoot.getTreeOrNull("/x");
-        assertNull(n);
+        Tree n = ourRoot.getTree("/x");
+        assertFalse(n.exists());
     }
 
 }

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=1477545&r1=1477544&r2=1477545&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 Tue Apr 30 10:44:32 2013
@@ -18,6 +18,13 @@
  */
 package org.apache.jackrabbit.oak.core;
 
+import static org.apache.jackrabbit.oak.api.Type.STRING;
+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.assertTrue;
+
 import org.apache.jackrabbit.oak.Oak;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.api.ContentSession;
@@ -30,11 +37,6 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
-import static org.apache.jackrabbit.oak.api.Type.STRING;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-
 public class DefaultConflictHandlerTheirsTest {
 
     private static final String OUR_VALUE = "our value";
@@ -52,7 +54,7 @@ public class DefaultConflictHandlerTheir
 
         // Add test content
         Root root = session.getLatestRoot();
-        Tree tree = root.getTreeOrNull("/");
+        Tree tree = root.getTree("/");
         tree.setProperty("a", 1);
         tree.setProperty("b", 2);
         tree.setProperty("c", 3);
@@ -73,96 +75,96 @@ public class DefaultConflictHandlerTheir
 
     @Test
     public void testAddExistingProperties() throws CommitFailedException {
-        theirRoot.getTreeOrNull("/").setProperty("p", THEIR_VALUE);
-        theirRoot.getTreeOrNull("/").setProperty("q", THEIR_VALUE);
-        ourRoot.getTreeOrNull("/").setProperty("p", OUR_VALUE);
-        ourRoot.getTreeOrNull("/").setProperty("q", OUR_VALUE);
+        theirRoot.getTree("/").setProperty("p", THEIR_VALUE);
+        theirRoot.getTree("/").setProperty("q", THEIR_VALUE);
+        ourRoot.getTree("/").setProperty("p", OUR_VALUE);
+        ourRoot.getTree("/").setProperty("q", OUR_VALUE);
 
         theirRoot.commit();
         ourRoot.commit();
 
-        PropertyState p = ourRoot.getTreeOrNull("/").getProperty("p");
+        PropertyState p = ourRoot.getTree("/").getProperty("p");
         assertNotNull(p);
         assertEquals(THEIR_VALUE, p.getValue(STRING));
 
-        PropertyState q = ourRoot.getTreeOrNull("/").getProperty("q");
+        PropertyState q = ourRoot.getTree("/").getProperty("q");
         assertNotNull(q);
         assertEquals(THEIR_VALUE, p.getValue(STRING));
     }
 
     @Test
     public void testChangeDeletedProperty() throws CommitFailedException {
-        theirRoot.getTreeOrNull("/").removeProperty("a");
-        ourRoot.getTreeOrNull("/").setProperty("a", OUR_VALUE);
+        theirRoot.getTree("/").removeProperty("a");
+        ourRoot.getTree("/").setProperty("a", OUR_VALUE);
 
         theirRoot.commit();
         ourRoot.commit();
 
-        PropertyState p = ourRoot.getTreeOrNull("/").getProperty("a");
+        PropertyState p = ourRoot.getTree("/").getProperty("a");
         assertNull(p);
     }
 
     @Test
     public void testChangeChangedProperty() throws CommitFailedException {
-        theirRoot.getTreeOrNull("/").setProperty("a", THEIR_VALUE);
-        ourRoot.getTreeOrNull("/").setProperty("a", OUR_VALUE);
+        theirRoot.getTree("/").setProperty("a", THEIR_VALUE);
+        ourRoot.getTree("/").setProperty("a", OUR_VALUE);
 
         theirRoot.commit();
         ourRoot.commit();
 
-        PropertyState p = ourRoot.getTreeOrNull("/").getProperty("a");
+        PropertyState p = ourRoot.getTree("/").getProperty("a");
         assertNotNull(p);
         assertEquals(THEIR_VALUE, p.getValue(STRING));
     }
 
     @Test
     public void testDeleteChangedProperty() throws CommitFailedException {
-        theirRoot.getTreeOrNull("/").setProperty("a", THEIR_VALUE);
-        ourRoot.getTreeOrNull("/").removeProperty("a");
+        theirRoot.getTree("/").setProperty("a", THEIR_VALUE);
+        ourRoot.getTree("/").removeProperty("a");
 
         theirRoot.commit();
         ourRoot.commit();
 
-        PropertyState p = ourRoot.getTreeOrNull("/").getProperty("a");
+        PropertyState p = ourRoot.getTree("/").getProperty("a");
         assertNotNull(p);
         assertEquals(THEIR_VALUE, p.getValue(STRING));
     }
 
     @Test
     public void testAddExistingNode() throws CommitFailedException {
-        theirRoot.getTreeOrNull("/").addChild("n").setProperty("p", THEIR_VALUE);
-        ourRoot.getTreeOrNull("/").addChild("n").setProperty("p", OUR_VALUE);
+        theirRoot.getTree("/").addChild("n").setProperty("p", THEIR_VALUE);
+        ourRoot.getTree("/").addChild("n").setProperty("p", OUR_VALUE);
 
         theirRoot.commit();
         ourRoot.commit();
 
-        Tree n = ourRoot.getTreeOrNull("/n");
+        Tree n = ourRoot.getTree("/n");
         assertNotNull(n);
         assertEquals(THEIR_VALUE, n.getProperty("p").getValue(STRING));
     }
 
     @Test
     public void testChangeDeletedNode() throws CommitFailedException {
-        theirRoot.getTreeOrNull("/x").remove();
-        ourRoot.getTreeOrNull("/x").setProperty("p", OUR_VALUE);
+        theirRoot.getTree("/x").remove();
+        ourRoot.getTree("/x").setProperty("p", OUR_VALUE);
 
         theirRoot.commit();
         ourRoot.commit();
 
-        Tree n = ourRoot.getTreeOrNull("/x");
-        assertNull(n);
+        Tree n = ourRoot.getTree("/x");
+        assertFalse(n.exists());
     }
 
     @Test
     public void testDeleteChangedNode() throws CommitFailedException {
-        theirRoot.getTreeOrNull("/x").setProperty("p", THEIR_VALUE);
-        ourRoot.getTreeOrNull("/x").remove();
+        theirRoot.getTree("/x").setProperty("p", THEIR_VALUE);
+        ourRoot.getTree("/x").remove();
 
         theirRoot.commit();
         ourRoot.commit();
 
-        Tree n = ourRoot.getTreeOrNull("/x");
-        assertNotNull(n);
+        Tree n = ourRoot.getTree("/x");
+        assertTrue(n.exists());
         assertEquals(THEIR_VALUE, n.getProperty("p").getValue(STRING));
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/LargeMoveTestIT.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/LargeMoveTestIT.java?rev=1477545&r1=1477544&r2=1477545&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/LargeMoveTestIT.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/LargeMoveTestIT.java Tue Apr 30 10:44:32 2013
@@ -44,7 +44,7 @@ public class LargeMoveTestIT extends Oak
         // Add test content
         Root root = session.getLatestRoot();
 
-        Tree tree = root.getTreeOrNull("/");
+        Tree tree = root.getTree("/");
         Tree treeA = tree.addChild("tree-a");
         this.treeAPath = treeA.getPath();
         Tree treeB = tree.addChild("tree-b");
@@ -69,7 +69,7 @@ public class LargeMoveTestIT extends Oak
 
         // Concurrent changes to trunk: enforce rebase
         Root root2 = session.getLatestRoot();
-        root2.getTreeOrNull("/").addChild("any");
+        root2.getTree("/").addChild("any");
         root2.commit();
 
         root1.move(treeAPath, PathUtils.concat(treeBPath, "tree-a-moved"));

Modified: 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/RootImplFuzzIT.java?rev=1477545&r1=1477544&r2=1477545&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/RootImplFuzzIT.java Tue Apr 30 10:44:32 2013
@@ -18,6 +18,15 @@
  */
 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.junit.Assert.assertEquals;
+
 import java.util.Iterator;
 import java.util.Random;
 
@@ -33,15 +42,6 @@ import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-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.junit.Assert.assertEquals;
-
 /**
  * Fuzz test running random sequences of operations on {@link Tree}.
  * Run with -DRootImplFuzzIT-seed=42 to set a specific seed (i.e. 42);
@@ -87,10 +87,10 @@ public class RootImplFuzzIT {
             log.info("{}", op);
             op.apply(root1);
             op.apply(root2);
-            checkEqual(root1.getTreeOrNull("/"), root2.getTreeOrNull("/"));
+            checkEqual(root1.getTree("/"), root2.getTree("/"));
 
             root1.commit();
-            checkEqual(root1.getTreeOrNull("/"), root2.getTreeOrNull("/"));
+            checkEqual(root1.getTree("/"), root2.getTree("/"));
             if (op instanceof Save) {
                 root2.commit();
                 assertEquals("seed " + SEED, store1.getRoot(), store2.getRoot());
@@ -138,7 +138,7 @@ public class RootImplFuzzIT {
 
             @Override
             void apply(RootImpl root) {
-                root.getTreeOrNull(parentPath).addChild(name);
+                root.getTree(parentPath).addChild(name);
             }
 
             @Override
@@ -158,7 +158,7 @@ public class RootImplFuzzIT {
             void apply(RootImpl root) {
                 String parentPath = PathUtils.getParentPath(path);
                 String name = PathUtils.getName(path);
-                root.getTreeOrNull(parentPath).getChildOrNull(name).remove();
+                root.getTree(parentPath).getChild(name).remove();
             }
 
             @Override
@@ -220,7 +220,7 @@ public class RootImplFuzzIT {
 
             @Override
             void apply(RootImpl root) {
-                root.getTreeOrNull(parentPath).setProperty(propertyName, propertyValue);
+                root.getTree(parentPath).setProperty(propertyName, propertyValue);
             }
 
             @Override
@@ -241,7 +241,7 @@ public class RootImplFuzzIT {
 
             @Override
             void apply(RootImpl root) {
-                root.getTreeOrNull(parentPath).removeProperty(name);
+                root.getTree(parentPath).removeProperty(name);
             }
 
             @Override
@@ -393,7 +393,7 @@ public class RootImplFuzzIT {
     }
 
     private String chooseNode(String parentPath) {
-        Tree state = root1.getTreeOrNull(parentPath);
+        Tree state = root1.getTree(parentPath);
 
         int k = random.nextInt((int) (state.getChildrenCount() + 1));
         int c = 0;
@@ -407,7 +407,7 @@ public class RootImplFuzzIT {
     }
 
     private String chooseProperty(String parentPath) {
-        Tree state = root1.getTreeOrNull(parentPath);
+        Tree state = root1.getTree(parentPath);
         int k = random.nextInt((int) (state.getPropertyCount() + 1));
         int c = 0;
         for (PropertyState entry : state.getProperties()) {
@@ -436,7 +436,7 @@ public class RootImplFuzzIT {
         }
 
         for (Tree child1 : tree1.getChildren()) {
-            checkEqual(child1, tree2.getChildOrNull(child1.getName()));
+            checkEqual(child1, tree2.getChild(child1.getName()));
         }
     }
 

Modified: 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/RootImplTest.java?rev=1477545&r1=1477544&r2=1477545&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/RootImplTest.java Tue Apr 30 10:44:32 2013
@@ -21,7 +21,6 @@ package org.apache.jackrabbit.oak.core;
 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.assertTrue;
 
 import java.util.ArrayList;
@@ -49,7 +48,7 @@ public class RootImplTest extends OakBas
 
         // Add test content
         Root root = session.getLatestRoot();
-        Tree tree = root.getTreeOrNull("/");
+        Tree tree = root.getTree("/");
         tree.setProperty("a", 1);
         tree.setProperty("b", 2);
         tree.setProperty("c", 3);
@@ -78,8 +77,8 @@ public class RootImplTest extends OakBas
         validPaths.add("/z");
 
         for (String treePath : validPaths) {
-            Tree tree = root.getTreeOrNull(treePath);
-            assertNotNull(tree);
+            Tree tree = root.getTree(treePath);
+            assertTrue(tree.exists());
             assertEquals(treePath, tree.getPath());
         }
 
@@ -88,18 +87,18 @@ public class RootImplTest extends OakBas
         invalidPaths.add("/x/any");
 
         for (String treePath : invalidPaths) {
-            assertNull(root.getTreeOrNull(treePath));
+            assertFalse(root.getTree(treePath).exists());
         }
     }
 
     @Test
     public void move() throws CommitFailedException {
         Root root = session.getLatestRoot();
-        Tree tree = root.getTreeOrNull("/");
+        Tree tree = root.getTree("/");
 
-        Tree y = tree.getChildOrNull("y");
-        Tree x = tree.getChildOrNull("x");
-        assertNotNull(x);
+        Tree y = tree.getChild("y");
+        Tree x = tree.getChild("x");
+        assertTrue(x.exists());
 
         root.move("/x", "/y/xx");
         assertFalse(tree.hasChild("x"));
@@ -110,26 +109,26 @@ public class RootImplTest extends OakBas
 
         assertFalse(tree.hasChild("x"));
         assertTrue(tree.hasChild("y"));
-        assertTrue(tree.getChildOrNull("y").hasChild("xx"));
+        assertTrue(tree.getChild("y").hasChild("xx"));
     }
 
     @Test
     public void moveRemoveAdd() {
         Root root = session.getLatestRoot();
 
-        Tree x = root.getTreeOrNull("/x");
-        Tree z = root.getTreeOrNull("/z");
+        Tree x = root.getTree("/x");
+        Tree z = root.getTree("/z");
         z.setProperty("p", "1");
 
         root.move("/z", "/x/z");
-        root.getTreeOrNull("/x/z").remove();
+        root.getTree("/x/z").remove();
 
         assertFalse(z.exists());
 
         x.addChild("z");
         assertEquals(Status.EXISTING, z.getStatus());
 
-        x.getChildOrNull("z").setProperty("p", "2");
+        x.getChild("z").setProperty("p", "2");
         PropertyState p = z.getProperty("p");
         assertNotNull(p);
         assertEquals("2", p.getValue(Type.STRING));
@@ -138,24 +137,24 @@ public class RootImplTest extends OakBas
     @Test
     public void moveNew() {
         Root root = session.getLatestRoot();
-        Tree tree = root.getTreeOrNull("/");
+        Tree tree = root.getTree("/");
 
         Tree t = tree.addChild("new");
 
         root.move("/new", "/y/new");
         assertEquals("/y/new", t.getPath());
 
-        assertNull(tree.getChildOrNull("new"));
+        assertFalse(tree.getChild("new").exists());
     }
 
     @Test
     public void moveExistingParent() throws CommitFailedException {
         Root root = session.getLatestRoot();
-        root.getTreeOrNull("/").addChild("parent").addChild("new");
+        root.getTree("/").addChild("parent").addChild("new");
         root.commit();
 
-        Tree parent = root.getTreeOrNull("/parent");
-        Tree n = root.getTreeOrNull("/parent/new");
+        Tree parent = root.getTree("/parent");
+        Tree n = root.getTree("/parent/new");
 
         root.move("/parent", "/moved");
 
@@ -172,7 +171,7 @@ public class RootImplTest extends OakBas
     @Test
     public void removeMoved() throws CommitFailedException {
         Root root = session.getLatestRoot();
-        Tree r = root.getTreeOrNull("/");
+        Tree r = root.getTree("/");
         r.addChild("a");
         r.addChild("b");
 
@@ -180,7 +179,7 @@ public class RootImplTest extends OakBas
         assertFalse(r.hasChild("a"));
         assertTrue(r.hasChild("b"));
 
-        r.getChildOrNull("b").remove();
+        r.getChild("b").remove();
         assertFalse(r.hasChild("a"));
         assertFalse(r.hasChild("b"));
 
@@ -192,9 +191,9 @@ public class RootImplTest extends OakBas
     @Test
     public void rename() throws CommitFailedException {
         Root root = session.getLatestRoot();
-        Tree tree = root.getTreeOrNull("/");
-        Tree x = tree.getChildOrNull("x");
-        assertNotNull(x);
+        Tree tree = root.getTree("/");
+        Tree x = tree.getChild("x");
+        assertTrue(x.exists());
 
         root.move("/x", "/xx");
         assertFalse(tree.hasChild("x"));
@@ -210,11 +209,11 @@ public class RootImplTest extends OakBas
     @Test
     public void copy() throws CommitFailedException {
         Root root = session.getLatestRoot();
-        Tree tree = root.getTreeOrNull("/");
+        Tree tree = root.getTree("/");
 
-        Tree y = tree.getChildOrNull("y");
-        Tree x = tree.getChildOrNull("x");
-        assertNotNull(x);
+        Tree y = tree.getChild("y");
+        Tree x = tree.getChild("x");
+        assertTrue(x.exists());
 
         assertTrue(tree.hasChild("x"));
         root.copy("/x", "/y/xx");
@@ -225,30 +224,30 @@ public class RootImplTest extends OakBas
 
         assertTrue(tree.hasChild("x"));
         assertTrue(tree.hasChild("y"));
-        assertTrue(tree.getChildOrNull("y").hasChild("xx"));
+        assertTrue(tree.getChild("y").hasChild("xx"));
     }
 
     @Test
     public void deepCopy() throws CommitFailedException {
         Root root = session.getLatestRoot();
-        Tree tree = root.getTreeOrNull("/");
+        Tree tree = root.getTree("/");
 
-        Tree y = tree.getChildOrNull("y");
+        Tree y = tree.getChild("y");
 
-        root.getTreeOrNull("/x").addChild("x1");
+        root.getTree("/x").addChild("x1");
         root.copy("/x", "/y/xx");
         assertTrue(y.hasChild("xx"));
-        assertTrue(y.getChildOrNull("xx").hasChild("x1"));
+        assertTrue(y.getChild("xx").hasChild("x1"));
 
         root.commit();
 
         assertTrue(tree.hasChild("x"));
         assertTrue(tree.hasChild("y"));
-        assertTrue(tree.getChildOrNull("y").hasChild("xx"));
-        assertTrue(tree.getChildOrNull("y").getChildOrNull("xx").hasChild("x1"));
+        assertTrue(tree.getChild("y").hasChild("xx"));
+        assertTrue(tree.getChild("y").getChild("xx").hasChild("x1"));
 
-        Tree x = tree.getChildOrNull("x");
-        Tree xx = tree.getChildOrNull("y").getChildOrNull("xx");
+        Tree x = tree.getChild("x");
+        Tree xx = tree.getChild("y").getChild("xx");
         checkEqual(x, xx);
     }
 
@@ -257,22 +256,22 @@ public class RootImplTest extends OakBas
         Root root1 = session.getLatestRoot();
         Root root2 = session.getLatestRoot();
 
-        checkEqual(root1.getTreeOrNull("/"), root2.getTreeOrNull("/"));
+        checkEqual(root1.getTree("/"), root2.getTree("/"));
 
-        root2.getTreeOrNull("/").addChild("one").addChild("two").addChild("three")
+        root2.getTree("/").addChild("one").addChild("two").addChild("three")
                 .setProperty("p1", "V1");
         root2.commit();
 
         root1.rebase();
-        checkEqual(root1.getTreeOrNull("/"), (root2.getTreeOrNull("/")));
+        checkEqual(root1.getTree("/"), (root2.getTree("/")));
 
-        Tree one = root2.getTreeOrNull("/one");
-        one.getChildOrNull("two").remove();
+        Tree one = root2.getTree("/one");
+        one.getChild("two").remove();
         one.addChild("four");
         root2.commit();
 
         root1.rebase();
-        checkEqual(root1.getTreeOrNull("/"), (root2.getTreeOrNull("/")));
+        checkEqual(root1.getTree("/"), (root2.getTree("/")));
     }
 
     @Test
@@ -280,17 +279,17 @@ public class RootImplTest extends OakBas
         Root root1 = session.getLatestRoot();
         Root root2 = session.getLatestRoot();
 
-        checkEqual(root1.getTreeOrNull("/"), root2.getTreeOrNull("/"));
+        checkEqual(root1.getTree("/"), root2.getTree("/"));
 
-        root2.getTreeOrNull("/").addChild("one").addChild("two").addChild("three")
+        root2.getTree("/").addChild("one").addChild("two").addChild("three")
                 .setProperty("p1", "V1");
         root2.commit();
 
-        root1.getTreeOrNull("/").addChild("child");
+        root1.getTree("/").addChild("child");
         root1.rebase();
 
-        root2.getTreeOrNull("/").addChild("child");
-        checkEqual(root1.getTreeOrNull("/"), (root2.getTreeOrNull("/")));
+        root2.getTree("/").addChild("child");
+        checkEqual(root1.getTree("/"), (root2.getTree("/")));
     }
 
     @Test
@@ -298,17 +297,17 @@ public class RootImplTest extends OakBas
         Root root1 = session.getLatestRoot();
         Root root2 = session.getLatestRoot();
 
-        checkEqual(root1.getTreeOrNull("/"), root2.getTreeOrNull("/"));
+        checkEqual(root1.getTree("/"), root2.getTree("/"));
 
-        root2.getTreeOrNull("/").addChild("one").addChild("two").addChild("three")
+        root2.getTree("/").addChild("one").addChild("two").addChild("three")
                 .setProperty("p1", "V1");
         root2.commit();
 
-        root1.getTreeOrNull("/").getChildOrNull("x").remove();
+        root1.getTree("/").getChild("x").remove();
         root1.rebase();
 
-        root2.getTreeOrNull("/").getChildOrNull("x").remove();
-        checkEqual(root1.getTreeOrNull("/"), (root2.getTreeOrNull("/")));
+        root2.getTree("/").getChild("x").remove();
+        checkEqual(root1.getTree("/"), (root2.getTree("/")));
     }
 
     @Test
@@ -316,17 +315,17 @@ public class RootImplTest extends OakBas
         Root root1 = session.getLatestRoot();
         Root root2 = session.getLatestRoot();
 
-        checkEqual(root1.getTreeOrNull("/"), root2.getTreeOrNull("/"));
+        checkEqual(root1.getTree("/"), root2.getTree("/"));
 
-        root2.getTreeOrNull("/").addChild("one").addChild("two").addChild("three")
+        root2.getTree("/").addChild("one").addChild("two").addChild("three")
                 .setProperty("p1", "V1");
         root2.commit();
 
-        root1.getTreeOrNull("/").setProperty("new", 42);
+        root1.getTree("/").setProperty("new", 42);
         root1.rebase();
 
-        root2.getTreeOrNull("/").setProperty("new", 42);
-        checkEqual(root1.getTreeOrNull("/"), (root2.getTreeOrNull("/")));
+        root2.getTree("/").setProperty("new", 42);
+        checkEqual(root1.getTree("/"), (root2.getTree("/")));
     }
 
     @Test
@@ -334,17 +333,17 @@ public class RootImplTest extends OakBas
         Root root1 = session.getLatestRoot();
         Root root2 = session.getLatestRoot();
 
-        checkEqual(root1.getTreeOrNull("/"), root2.getTreeOrNull("/"));
+        checkEqual(root1.getTree("/"), root2.getTree("/"));
 
-        root2.getTreeOrNull("/").addChild("one").addChild("two").addChild("three")
+        root2.getTree("/").addChild("one").addChild("two").addChild("three")
                 .setProperty("p1", "V1");
         root2.commit();
 
-        root1.getTreeOrNull("/").removeProperty("a");
+        root1.getTree("/").removeProperty("a");
         root1.rebase();
 
-        root2.getTreeOrNull("/").removeProperty("a");
-        checkEqual(root1.getTreeOrNull("/"), (root2.getTreeOrNull("/")));
+        root2.getTree("/").removeProperty("a");
+        checkEqual(root1.getTree("/"), (root2.getTree("/")));
     }
 
     @Test
@@ -352,17 +351,17 @@ public class RootImplTest extends OakBas
         Root root1 = session.getLatestRoot();
         Root root2 = session.getLatestRoot();
 
-        checkEqual(root1.getTreeOrNull("/"), root2.getTreeOrNull("/"));
+        checkEqual(root1.getTree("/"), root2.getTree("/"));
 
-        root2.getTreeOrNull("/").addChild("one").addChild("two").addChild("three")
+        root2.getTree("/").addChild("one").addChild("two").addChild("three")
                 .setProperty("p1", "V1");
         root2.commit();
 
-        root1.getTreeOrNull("/").setProperty("a", 42);
+        root1.getTree("/").setProperty("a", 42);
         root1.rebase();
 
-        root2.getTreeOrNull("/").setProperty("a", 42);
-        checkEqual(root1.getTreeOrNull("/"), (root2.getTreeOrNull("/")));
+        root2.getTree("/").setProperty("a", 42);
+        checkEqual(root1.getTree("/"), (root2.getTree("/")));
     }
 
     @Test
@@ -370,9 +369,9 @@ public class RootImplTest extends OakBas
         Root root1 = session.getLatestRoot();
         Root root2 = session.getLatestRoot();
 
-        checkEqual(root1.getTreeOrNull("/"), root2.getTreeOrNull("/"));
+        checkEqual(root1.getTree("/"), root2.getTree("/"));
 
-        root2.getTreeOrNull("/").addChild("one").addChild("two").addChild("three")
+        root2.getTree("/").addChild("one").addChild("two").addChild("three")
                 .setProperty("p1", "V1");
         root2.commit();
 
@@ -380,7 +379,7 @@ public class RootImplTest extends OakBas
         root1.rebase();
 
         root2.move("/x", "/y/x-moved");
-        checkEqual(root1.getTreeOrNull("/"), (root2.getTreeOrNull("/")));
+        checkEqual(root1.getTree("/"), (root2.getTree("/")));
     }
 
     @Test
@@ -388,9 +387,9 @@ public class RootImplTest extends OakBas
         Root root1 = session.getLatestRoot();
         Root root2 = session.getLatestRoot();
 
-        checkEqual(root1.getTreeOrNull("/"), root2.getTreeOrNull("/"));
+        checkEqual(root1.getTree("/"), root2.getTree("/"));
 
-        root2.getTreeOrNull("/").addChild("one").addChild("two").addChild("three")
+        root2.getTree("/").addChild("one").addChild("two").addChild("three")
                 .setProperty("p1", "V1");
         root2.commit();
 
@@ -398,7 +397,7 @@ public class RootImplTest extends OakBas
         root1.rebase();
 
         root2.copy("/x", "/y/x-copied");
-        checkEqual(root1.getTreeOrNull("/"), (root2.getTreeOrNull("/")));
+        checkEqual(root1.getTree("/"), (root2.getTree("/")));
     }
 
     private static void checkEqual(Tree tree1, Tree tree2) {
@@ -410,7 +409,7 @@ public class RootImplTest extends OakBas
         }
 
         for (Tree child1 : tree1.getChildren()) {
-            checkEqual(child1, tree2.getChildOrNull(child1.getName()));
+            checkEqual(child1, tree2.getChild(child1.getName()));
         }
     }
 }

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/TreeImplTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/TreeImplTest.java?rev=1477545&r1=1477544&r2=1477545&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/TreeImplTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/TreeImplTest.java Tue Apr 30 10:44:32 2013
@@ -54,7 +54,7 @@ public class TreeImplTest extends OakBas
 
         // Add test content
         root = session.getLatestRoot();
-        Tree tree = root.getTreeOrNull("/");
+        Tree tree = root.getTree("/");
         tree.setProperty("a", 1);
         tree.setProperty("b", 2);
         tree.setProperty("c", 3);
@@ -74,18 +74,18 @@ public class TreeImplTest extends OakBas
 
     @Test
     public void getChild() {
-        Tree tree = root.getTreeOrNull("/");
+        Tree tree = root.getTree("/");
 
-        Tree child = tree.getChildOrNull("any");
-        assertNull(child);
+        Tree child = tree.getChild("any");
+        assertFalse(child.exists());
 
-        child = tree.getChildOrNull("x");
-        assertNotNull(child);
+        child = tree.getChild("x");
+        assertTrue(child.exists());
     }
 
     @Test
     public void getProperty() {
-        Tree tree = root.getTreeOrNull("/");
+        Tree tree = root.getTree("/");
 
         PropertyState propertyState = tree.getProperty("any");
         assertNull(propertyState);
@@ -99,7 +99,7 @@ public class TreeImplTest extends OakBas
 
     @Test
     public void getChildren() {
-        Tree tree = root.getTreeOrNull("/");
+        Tree tree = root.getTree("/");
 
         Iterable<Tree> children = tree.getChildren();
 
@@ -116,7 +116,7 @@ public class TreeImplTest extends OakBas
 
     @Test
     public void getProperties() {
-        Tree tree = root.getTreeOrNull("/");
+        Tree tree = root.getTree("/");
 
         Set<PropertyState> expectedProperties = Sets.newHashSet(
                 LongPropertyState.createLongProperty("a", 1L),
@@ -134,11 +134,11 @@ public class TreeImplTest extends OakBas
 
     @Test
     public void addChild() throws CommitFailedException {
-        Tree tree = root.getTreeOrNull("/");
+        Tree tree = root.getTree("/");
 
         assertFalse(tree.hasChild("new"));
         Tree added = tree.addChild("new");
-        assertNotNull(added);
+        assertTrue(added.exists());
         assertEquals("new", added.getName());
         assertTrue(tree.hasChild("new"));
 
@@ -146,13 +146,13 @@ public class TreeImplTest extends OakBas
 
         assertTrue(tree.hasChild("new"));
 
-        tree.getChildOrNull("new").addChild("more");
-        assertTrue(tree.getChildOrNull("new").hasChild("more"));
+        tree.getChild("new").addChild("more");
+        assertTrue(tree.getChild("new").hasChild("more"));
     }
 
     @Test
     public void addExistingChild() throws CommitFailedException {
-        Tree tree = root.getTreeOrNull("/");
+        Tree tree = root.getTree("/");
 
         assertFalse(tree.hasChild("new"));
         tree.addChild("new");
@@ -161,16 +161,16 @@ public class TreeImplTest extends OakBas
 
         assertTrue(tree.hasChild("new"));
         Tree added = tree.addChild("new");
-        assertNotNull(added);
+        assertTrue(added.exists());
         assertEquals("new", added.getName());
     }
 
     @Test
     public void removeChild() throws CommitFailedException {
-        Tree tree = root.getTreeOrNull("/");
+        Tree tree = root.getTree("/");
 
         assertTrue(tree.hasChild("x"));
-        tree.getChildOrNull("x").remove();
+        tree.getChild("x").remove();
         assertFalse(tree.hasChild("x"));
 
         root.commit();
@@ -180,19 +180,19 @@ public class TreeImplTest extends OakBas
 
     @Test
     public void removeNew() {
-        Tree tree = root.getTreeOrNull("/");
+        Tree tree = root.getTree("/");
 
         Tree t = tree.addChild("new");
 
-        tree.getChildOrNull("new").remove();
+        tree.getChild("new").remove();
         assertFalse(t.exists());
 
-        assertNull(tree.getChildOrNull("new"));
+        assertFalse(tree.getChild("new").exists());
     }
 
     @Test
     public void setProperty() throws CommitFailedException {
-        Tree tree = root.getTreeOrNull("/");
+        Tree tree = root.getTree("/");
 
         assertFalse(tree.hasProperty("new"));
         tree.setProperty("new", "value");
@@ -211,7 +211,7 @@ public class TreeImplTest extends OakBas
 
     @Test
     public void removeProperty() throws CommitFailedException {
-        Tree tree = root.getTreeOrNull("/");
+        Tree tree = root.getTree("/");
 
         assertTrue(tree.hasProperty("a"));
         tree.removeProperty("a");
@@ -224,11 +224,11 @@ public class TreeImplTest extends OakBas
 
     @Test
     public void getChildrenCount() {
-        Tree tree = root.getTreeOrNull("/");
+        Tree tree = root.getTree("/");
 
         assertEquals(3, tree.getChildrenCount());
 
-        tree.getChildOrNull("x").remove();
+        tree.getChild("x").remove();
         assertEquals(2, tree.getChildrenCount());
 
         tree.addChild("a");
@@ -240,7 +240,7 @@ public class TreeImplTest extends OakBas
 
     @Test
     public void getPropertyCount() {
-        Tree tree = root.getTreeOrNull("/");
+        Tree tree = root.getTree("/");
 
         assertEquals(3, tree.getPropertyCount());
 
@@ -259,7 +259,7 @@ public class TreeImplTest extends OakBas
 
     @Test
     public void addAndRemoveProperty() throws CommitFailedException {
-        Tree tree = root.getTreeOrNull("/");
+        Tree tree = root.getTree("/");
 
         tree.setProperty("P0", "V1");
         root.commit();
@@ -274,27 +274,27 @@ public class TreeImplTest extends OakBas
 
     @Test
     public void nodeStatus() throws CommitFailedException {
-        Tree tree = root.getTreeOrNull("/");
+        Tree tree = root.getTree("/");
 
         tree.addChild("new");
-        assertEquals(Tree.Status.NEW, tree.getChildOrNull("new").getStatus());
+        assertEquals(Tree.Status.NEW, tree.getChild("new").getStatus());
         root.commit();
 
-        assertEquals(Tree.Status.EXISTING, tree.getChildOrNull("new").getStatus());
-        Tree added = tree.getChildOrNull("new");
+        assertEquals(Tree.Status.EXISTING, tree.getChild("new").getStatus());
+        Tree added = tree.getChild("new");
         added.addChild("another");
-        assertEquals(Tree.Status.MODIFIED, tree.getChildOrNull("new").getStatus());
+        assertEquals(Tree.Status.MODIFIED, tree.getChild("new").getStatus());
         root.commit();
 
-        assertEquals(Tree.Status.EXISTING, tree.getChildOrNull("new").getStatus());
-        tree.getChildOrNull("new").getChildOrNull("another").remove();
-        assertEquals(Tree.Status.MODIFIED, tree.getChildOrNull("new").getStatus());
+        assertEquals(Tree.Status.EXISTING, tree.getChild("new").getStatus());
+        tree.getChild("new").getChild("another").remove();
+        assertEquals(Tree.Status.MODIFIED, tree.getChild("new").getStatus());
         root.commit();
 
-        assertEquals(Tree.Status.EXISTING, tree.getChildOrNull("new").getStatus());
-        assertNull(tree.getChildOrNull("new").getChildOrNull("another"));
+        assertEquals(Tree.Status.EXISTING, tree.getChild("new").getStatus());
+        assertFalse(tree.getChild("new").getChild("another").exists());
 
-        Tree x = root.getTreeOrNull("/x");
+        Tree x = root.getTree("/x");
         Tree y = x.addChild("y");
         x.remove();
 
@@ -304,7 +304,7 @@ public class TreeImplTest extends OakBas
 
     @Test
     public void propertyStatus() throws CommitFailedException {
-        Tree tree = root.getTreeOrNull("/");
+        Tree tree = root.getTree("/");
 
         tree.setProperty("new", "value1");
         assertEquals(Tree.Status.NEW, tree.getPropertyStatus("new"));
@@ -322,25 +322,25 @@ public class TreeImplTest extends OakBas
 
         assertNull(tree.getPropertyStatus("new"));
 
-        Tree x = root.getTreeOrNull("/x");
+        Tree x = root.getTree("/x");
         x.setProperty("y", "value1");
         x.remove();
     }
 
     @Test
     public void noTransitiveModifiedStatus() throws CommitFailedException {
-        Tree tree = root.getTreeOrNull("/");
+        Tree tree = root.getTree("/");
         tree.addChild("one").addChild("two");
         root.commit();
 
-        tree.getChildOrNull("one").getChildOrNull("two").addChild("three");
-        assertEquals(Tree.Status.EXISTING, tree.getChildOrNull("one").getStatus());
-        assertEquals(Tree.Status.MODIFIED, tree.getChildOrNull("one").getChildOrNull("two").getStatus());
+        tree.getChild("one").getChild("two").addChild("three");
+        assertEquals(Tree.Status.EXISTING, tree.getChild("one").getStatus());
+        assertEquals(Tree.Status.MODIFIED, tree.getChild("one").getChild("two").getStatus());
     }
 
     @Test
     public void largeChildList() throws CommitFailedException {
-        Tree tree = root.getTreeOrNull("/");
+        Tree tree = root.getTree("/");
         Set<String> added = new HashSet<String>();
 
         Tree large = tree.addChild("large");
@@ -361,7 +361,7 @@ public class TreeImplTest extends OakBas
 
     @Test
     public void testSetOrderableChildrenSetsProperty() throws Exception {
-        Tree tree = root.getTreeOrNull("/").addChild("test");
+        Tree tree = root.getTree("/").addChild("test");
         tree.setOrderableChildren(true);
         assertTrue(((TreeImpl) tree).getNodeState().hasProperty(TreeImpl.OAK_CHILD_ORDER));
 
@@ -381,7 +381,7 @@ public class TreeImplTest extends OakBas
 
     @Test
     public void testSetOrderableChildren() throws Exception {
-        Tree tree = root.getTreeOrNull("/").addChild("test2");
+        Tree tree = root.getTree("/").addChild("test2");
         tree.setOrderableChildren(true);
 
         String[] childNames = new String[]{"a", "b", "c", "d"};
@@ -397,7 +397,7 @@ public class TreeImplTest extends OakBas
 
     @Test
     public void testDisconnectAfterRefresh() {
-        Tree x = root.getTreeOrNull("/x");
+        Tree x = root.getTree("/x");
         x.setProperty("p", "any");
         Tree xx = x.addChild("xx");
         xx.setProperty("q", "any");
@@ -416,7 +416,7 @@ public class TreeImplTest extends OakBas
 
     @Test
     public void testDisconnectAfterRemove() {
-        Tree x = root.getTreeOrNull("/x");
+        Tree x = root.getTree("/x");
         x.setProperty("p", "any");
         Tree xx = x.addChild("xx");
         xx.setProperty("q", "any");
@@ -426,7 +426,7 @@ public class TreeImplTest extends OakBas
         assertEquals(Status.NEW, xx.getStatus());
         assertEquals(Status.NEW, xx.getPropertyStatus("q"));
 
-        root.getTreeOrNull("/x").remove();
+        root.getTree("/x").remove();
 
         assertFalse(x.exists());
         assertFalse(xx.exists());

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/TreeLocationTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/TreeLocationTest.java?rev=1477545&r1=1477544&r2=1477545&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/TreeLocationTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/TreeLocationTest.java Tue Apr 30 10:44:32 2013
@@ -44,7 +44,7 @@ public class TreeLocationTest extends Oa
 
         // Add test content
         root = session.getLatestRoot();
-        Tree tree = root.getTreeOrNull("/");
+        Tree tree = root.getTree("/");
         tree.setProperty("a", 1);
         tree.setProperty("b", 2);
         tree.setProperty("c", 3);



Mime
View raw message