jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1478108 - in /jackrabbit/oak/trunk: oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/ oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/index/ oak-solr-core/src/test/java/org/apache/jackrabbit/...
Date Wed, 01 May 2013 17:41:38 GMT
Author: mduerig
Date: Wed May  1 17:41:37 2013
New Revision: 1478108

URL: http://svn.apache.org/r1478108
Log:
OAK-798: Review / refactor TreeImpl and related classes
reduce usage of deprecated methods: replace Root.getTreeOrNull with Root.getTree

Modified:
    jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexQueryTest.java
    jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/index/SolrCommitHookIT.java
    jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrIndexQueryTest.java
    jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrQueryEngineIT.java

Modified: jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexQueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexQueryTest.java?rev=1478108&r1=1478107&r2=1478108&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexQueryTest.java
(original)
+++ jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexQueryTest.java
Wed May  1 17:41:37 2013
@@ -16,6 +16,10 @@
  */
 package org.apache.jackrabbit.oak.plugins.index.lucene;
 
+import static junit.framework.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
 import java.util.Iterator;
 
 import org.apache.jackrabbit.oak.Oak;
@@ -28,10 +32,6 @@ import org.apache.jackrabbit.oak.spi.sec
 import org.junit.Ignore;
 import org.junit.Test;
 
-import static junit.framework.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
 /**
  * Tests the query engine using the default index implementation: the
  * {@link LuceneIndexProvider}
@@ -40,7 +40,7 @@ public class LuceneIndexQueryTest extend
 
     @Override
     protected void createTestIndexNode() throws Exception {
-        Tree index = root.getTreeOrNull("/");
+        Tree index = root.getTree("/");
         createTestIndexNode(index, LuceneIndexConstants.TYPE_LUCENE);
         root.commit();
     }

Modified: jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/index/SolrCommitHookIT.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/index/SolrCommitHookIT.java?rev=1478108&r1=1478107&r2=1478108&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/index/SolrCommitHookIT.java
(original)
+++ jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/index/SolrCommitHookIT.java
Wed May  1 17:41:37 2013
@@ -16,6 +16,8 @@
  */
 package org.apache.jackrabbit.oak.plugins.index.solr.index;
 
+import static org.junit.Assert.assertTrue;
+
 import javax.security.auth.Subject;
 
 import org.apache.jackrabbit.oak.api.Root;
@@ -28,8 +30,6 @@ import org.apache.solr.client.solrj.resp
 import org.apache.solr.common.SolrInputDocument;
 import org.junit.Test;
 
-import static org.junit.Assert.assertTrue;
-
 /**
  * Integration test for {@link org.apache.jackrabbit.oak.plugins.index.solr.index.SolrCommitHook}
  */
@@ -44,13 +44,13 @@ public class SolrCommitHookIT extends So
     @Test
     public void testAddSomeNodes() throws Exception {
         Root r = createRootImpl();
-        r.getTreeOrNull("/").addChild("a").addChild("b").addChild("doc1").
+        r.getTree("/").addChild("a").addChild("b").addChild("doc1").
                 setProperty("text", "hit that hot hat tattoo");
-        r.getTreeOrNull("/").getChildOrNull("a").addChild("c").addChild("doc2").
+        r.getTree("/").getChild("a").addChild("c").addChild("doc2").
                 setProperty("text", "it hits hot hats");
-        r.getTreeOrNull("/").getChildOrNull("a").getChildOrNull("b").addChild("doc3").
+        r.getTree("/").getChild("a").getChild("b").addChild("doc3").
                 setProperty("text", "tattoos hate hot hits");
-        r.getTreeOrNull("/").getChildOrNull("a").getChildOrNull("b").addChild("doc4").
+        r.getTree("/").getChild("a").getChild("b").addChild("doc4").
                 setProperty("text", "hats tattoos hit hot");
         r.commit();
 
@@ -70,7 +70,7 @@ public class SolrCommitHookIT extends So
 
         // remove the node in oak
         Root r = createRootImpl();
-        r.getTreeOrNull("/").getChildOrNull("z").remove();
+        r.getTree("/").getChild("z").remove();
         r.commit();
 
         // check the node is not in Solr anymore

Modified: jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrIndexQueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrIndexQueryTest.java?rev=1478108&r1=1478107&r2=1478108&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrIndexQueryTest.java
(original)
+++ jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrIndexQueryTest.java
Wed May  1 17:41:37 2013
@@ -16,6 +16,10 @@
  */
 package org.apache.jackrabbit.oak.plugins.index.solr.query;
 
+import static junit.framework.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
 import java.util.Iterator;
 
 import org.apache.jackrabbit.oak.Oak;
@@ -32,10 +36,6 @@ import org.junit.After;
 import org.junit.Ignore;
 import org.junit.Test;
 
-import static junit.framework.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
 /**
  * General query extensive testcase for {@link SolrQueryIndex} and {@link
  * org.apache.jackrabbit.oak.plugins.index.solr.index.SolrIndexDiff}
@@ -52,7 +52,7 @@ public class SolrIndexQueryTest extends 
 
     @Override
     protected void createTestIndexNode() throws Exception {
-        Tree index = root.getTreeOrNull("/");
+        Tree index = root.getTree("/");
         createTestIndexNode(index, SolrQueryIndex.TYPE);
         root.commit();
     }

Modified: jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrQueryEngineIT.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrQueryEngineIT.java?rev=1478108&r1=1478107&r2=1478108&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrQueryEngineIT.java
(original)
+++ jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrQueryEngineIT.java
Wed May  1 17:41:37 2013
@@ -57,7 +57,7 @@ public class SolrQueryEngineIT extends S
         IndexDefinition testID = new IndexDefinitionImpl("solr-test",
                 "solr", "/");
         Root root = createRootImpl();
-        Tree tree = root.getTreeOrNull("/");
+        Tree tree = root.getTree("/");
 
         tree.addChild("somenode").setProperty("foo", "bar");
         root.commit();



Mime
View raw message