jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexparvule...@apache.org
Subject svn commit: r1464016 [2/2] - in /jackrabbit/oak/trunk: oak-core/ oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/ oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/nodetype/ oak-core/src/main/java/org/apache/jackrabbit/oak/p...
Date Wed, 03 Apr 2013 13:54:23 GMT
Modified: jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/index/SolrIndexDiffIT.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/index/SolrIndexDiffIT.java?rev=1464016&r1=1464015&r2=1464016&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/index/SolrIndexDiffIT.java
(original)
+++ jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/index/SolrIndexDiffIT.java
Wed Apr  3 13:54:22 2013
@@ -18,12 +18,14 @@ package org.apache.jackrabbit.oak.plugin
 
 import org.apache.jackrabbit.oak.plugins.index.IndexDefinition;
 import org.apache.jackrabbit.oak.plugins.index.IndexDefinitionImpl;
-import org.apache.jackrabbit.oak.plugins.index.IndexHook;
 import org.apache.jackrabbit.oak.plugins.index.solr.index.SolrIndexDiff;
 import org.apache.jackrabbit.oak.query.ast.Operator;
 import org.apache.jackrabbit.oak.query.index.FilterImpl;
 import org.apache.jackrabbit.oak.plugins.index.solr.SolrBaseTest;
 import org.apache.jackrabbit.oak.plugins.index.solr.query.SolrQueryIndex;
+import org.apache.jackrabbit.oak.spi.commit.Editor;
+import org.apache.jackrabbit.oak.spi.commit.EditorHook;
+import org.apache.jackrabbit.oak.spi.commit.EditorProvider;
 import org.apache.jackrabbit.oak.spi.query.Cursor;
 import org.apache.jackrabbit.oak.spi.query.Filter;
 import org.apache.jackrabbit.oak.spi.query.IndexRow;
@@ -55,10 +57,15 @@ public class SolrIndexDiffIT extends Sol
         builder.child("newnode").setProperty("prop", "val");
         NodeState after = builder.getNodeState();
 
-        IndexHook l = new SolrIndexDiff(builder, server, configuration);
-        after.compareAgainstBaseState(before, l);
-        l.apply();
-        l.close();
+        EditorProvider provider = new EditorProvider() {
+            @Override
+            public Editor getRootEditor(NodeState before, NodeState after,
+                    NodeBuilder builder) {
+                return new SolrIndexDiff(builder, server, configuration);
+            }
+        };
+        EditorHook hook = new EditorHook(provider);
+        NodeState indexed = hook.processCommit(before, after);
 
         IndexDefinition testDef = new IndexDefinitionImpl("solr",
                 "solr", "/oak:index/solr");
@@ -67,7 +74,7 @@ public class SolrIndexDiffIT extends Sol
         filter.restrictPath("/newnode", Filter.PathRestriction.EXACT);
         filter.restrictProperty("prop", Operator.EQUAL,
                 PropertyValues.newString("val"));
-        Cursor cursor = queryIndex.query(filter, builder.getNodeState());
+        Cursor cursor = queryIndex.query(filter, indexed);
         assertNotNull(cursor);
         assertTrue("no results found", cursor.hasNext());
         IndexRow next = cursor.next();
@@ -89,10 +96,15 @@ public class SolrIndexDiffIT extends Sol
         builder.setProperty("foo", "bar");
         NodeState after = builder.getNodeState();
 
-        IndexHook l = new SolrIndexDiff(builder, server, configuration);
-        after.compareAgainstBaseState(before, l);
-        l.apply();
-        l.close();
+        EditorProvider provider = new EditorProvider() {
+            @Override
+            public Editor getRootEditor(NodeState before, NodeState after,
+                    NodeBuilder builder) {
+                return new SolrIndexDiff(builder, server, configuration);
+            }
+        };
+        EditorHook hook = new EditorHook(provider);
+        NodeState indexed = hook.processCommit(before, after);
 
         IndexDefinition testDef = new IndexDefinitionImpl("solr",
                 "solr", "/oak:index/solr");
@@ -100,7 +112,7 @@ public class SolrIndexDiffIT extends Sol
         FilterImpl filter = new FilterImpl(null, null);
         filter.restrictProperty("foo", Operator.EQUAL,
                 PropertyValues.newString("bar"));
-        Cursor cursor = queryIndex.query(filter, builder.getNodeState());
+        Cursor cursor = queryIndex.query(filter, indexed);
         assertNotNull(cursor);
         assertTrue("no results found", cursor.hasNext());
         IndexRow next = cursor.next();
@@ -128,10 +140,15 @@ public class SolrIndexDiffIT extends Sol
 
         NodeState after = builder.getNodeState();
 
-        IndexHook l = new SolrIndexDiff(builder, server, configuration);
-        after.compareAgainstBaseState(before, l);
-        l.apply();
-        l.close();
+        EditorProvider provider = new EditorProvider() {
+            @Override
+            public Editor getRootEditor(NodeState before, NodeState after,
+                    NodeBuilder builder) {
+                return new SolrIndexDiff(builder, server, configuration);
+            }
+        };
+        EditorHook hook = new EditorHook(provider);
+        NodeState indexed = hook.processCommit(before, after);
 
         IndexDefinition testDef = new IndexDefinitionImpl("solr",
                 "solr", "/oak:index/solr");
@@ -140,7 +157,7 @@ public class SolrIndexDiffIT extends Sol
         filter.restrictProperty("foo", Operator.EQUAL,
                 PropertyValues.newString("bar"));
         filter.restrictFulltextCondition("bar");
-        Cursor cursor = queryIndex.query(filter, builder.getNodeState());
+        Cursor cursor = queryIndex.query(filter, indexed);
 
         assertTrue(cursor.hasNext());
         assertEquals("/", cursor.next().getPath());
@@ -167,17 +184,22 @@ public class SolrIndexDiffIT extends Sol
 
         NodeState after = builder.getNodeState();
 
-        IndexHook l = new SolrIndexDiff(builder, server, configuration);
-        after.compareAgainstBaseState(before, l);
-        l.apply();
-        l.close();
+        EditorProvider provider = new EditorProvider() {
+            @Override
+            public Editor getRootEditor(NodeState before, NodeState after,
+                    NodeBuilder builder) {
+                return new SolrIndexDiff(builder, server, configuration);
+            }
+        };
+        EditorHook hook = new EditorHook(provider);
+        NodeState indexed = hook.processCommit(before, after);
 
         IndexDefinition testDef = new IndexDefinitionImpl("solr",
                 "solr", "/oak:index/solr");
         QueryIndex queryIndex = new SolrQueryIndex(testDef, server, configuration);
         FilterImpl filter = new FilterImpl(null, null);
         filter.restrictPath("/a", Filter.PathRestriction.ALL_CHILDREN);
-        Cursor cursor = queryIndex.query(filter, builder.getNodeState());
+        Cursor cursor = queryIndex.query(filter, indexed);
 
         assertTrue(cursor.hasNext());
         assertEquals("/a", cursor.next().getPath());

Modified: jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/index/SolrIndexHookIT.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/index/SolrIndexHookIT.java?rev=1464016&r1=1464015&r2=1464016&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/index/SolrIndexHookIT.java
(original)
+++ jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/index/SolrIndexHookIT.java
Wed Apr  3 13:54:22 2013
@@ -18,12 +18,13 @@ package org.apache.jackrabbit.oak.plugin
 
 import org.apache.jackrabbit.oak.plugins.index.IndexDefinition;
 import org.apache.jackrabbit.oak.plugins.index.IndexDefinitionImpl;
-import org.apache.jackrabbit.oak.plugins.index.IndexHook;
-import org.apache.jackrabbit.oak.plugins.index.solr.index.SolrIndexHook;
 import org.apache.jackrabbit.oak.query.ast.Operator;
 import org.apache.jackrabbit.oak.query.index.FilterImpl;
 import org.apache.jackrabbit.oak.plugins.index.solr.SolrBaseTest;
 import org.apache.jackrabbit.oak.plugins.index.solr.query.SolrQueryIndex;
+import org.apache.jackrabbit.oak.spi.commit.Editor;
+import org.apache.jackrabbit.oak.spi.commit.EditorHook;
+import org.apache.jackrabbit.oak.spi.commit.EditorProvider;
 import org.apache.jackrabbit.oak.spi.query.Cursor;
 import org.apache.jackrabbit.oak.spi.query.Filter;
 import org.apache.jackrabbit.oak.spi.query.IndexRow;
@@ -55,10 +56,15 @@ public class SolrIndexHookIT extends Sol
         builder.child("newnode").setProperty("prop", "val");
         NodeState after = builder.getNodeState();
 
-        IndexHook l = new SolrIndexHook("/", builder, server);
-        after.compareAgainstBaseState(before, l);
-        l.apply();
-        l.close();
+        EditorProvider provider = new EditorProvider() {
+            @Override
+            public Editor getRootEditor(NodeState before, NodeState after,
+                    NodeBuilder builder) {
+                return new SolrIndexHook("/", builder, server);
+            }
+        };
+        EditorHook hook = new EditorHook(provider);
+        NodeState indexed = hook.processCommit(before, after);
 
         IndexDefinition testDef = new IndexDefinitionImpl("solr",
                 "solr", "/oak:index/solr");
@@ -67,7 +73,7 @@ public class SolrIndexHookIT extends Sol
         filter.restrictPath("newnode", Filter.PathRestriction.EXACT);
         filter.restrictProperty("prop", Operator.EQUAL,
                 PropertyValues.newString("val"));
-        Cursor cursor = queryIndex.query(filter, builder.getNodeState());
+        Cursor cursor = queryIndex.query(filter, indexed);
         assertNotNull(cursor);
         assertTrue("no results found", cursor.hasNext());
         IndexRow next = cursor.next();
@@ -89,10 +95,15 @@ public class SolrIndexHookIT extends Sol
         builder.setProperty("foo", "bar");
         NodeState after = builder.getNodeState();
 
-        IndexHook l = new SolrIndexHook("/", builder, server);
-        after.compareAgainstBaseState(before, l);
-        l.apply();
-        l.close();
+        EditorProvider provider = new EditorProvider() {
+            @Override
+            public Editor getRootEditor(NodeState before, NodeState after,
+                    NodeBuilder builder) {
+                return new SolrIndexHook("/", builder, server);
+            }
+        };
+        EditorHook hook = new EditorHook(provider);
+        NodeState indexed = hook.processCommit(before, after);
 
         IndexDefinition testDef = new IndexDefinitionImpl("solr",
                 "solr", "/oak:index/solr");
@@ -100,7 +111,7 @@ public class SolrIndexHookIT extends Sol
         FilterImpl filter = new FilterImpl(null, null);
         filter.restrictProperty("foo", Operator.EQUAL,
                 PropertyValues.newString("bar"));
-        Cursor cursor = queryIndex.query(filter, builder.getNodeState());
+        Cursor cursor = queryIndex.query(filter, indexed);
         assertNotNull(cursor);
         assertTrue("no results found", cursor.hasNext());
         IndexRow next = cursor.next();
@@ -128,10 +139,15 @@ public class SolrIndexHookIT extends Sol
 
         NodeState after = builder.getNodeState();
 
-        IndexHook l = new SolrIndexHook("/", builder, server);
-        after.compareAgainstBaseState(before, l);
-        l.apply();
-        l.close();
+        EditorProvider provider = new EditorProvider() {
+            @Override
+            public Editor getRootEditor(NodeState before, NodeState after,
+                    NodeBuilder builder) {
+                return new SolrIndexHook("/", builder, server);
+            }
+        };
+        EditorHook hook = new EditorHook(provider);
+        NodeState indexed = hook.processCommit(before, after);
 
         IndexDefinition testDef = new IndexDefinitionImpl("solr",
                 "solr", "/oak:index/solr");
@@ -140,7 +156,7 @@ public class SolrIndexHookIT extends Sol
         filter.restrictProperty("foo", Operator.EQUAL,
                 PropertyValues.newString("bar"));
         filter.restrictFulltextCondition("bar");
-        Cursor cursor = queryIndex.query(filter, builder.getNodeState());
+        Cursor cursor = queryIndex.query(filter, indexed);
 
         assertTrue(cursor.hasNext());
         assertEquals("/", cursor.next().getPath());

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=1464016&r1=1464015&r2=1464016&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 Apr  3 13:54:22 2013
@@ -73,6 +73,7 @@ public class SolrIndexQueryTest extends 
     }
 
     @Test
+    @Ignore("OAK-740")
     public void sql2() throws Exception {
         test("sql2.txt");
     }



Mime
View raw message