jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexparvule...@apache.org
Subject svn commit: r1475754 [2/2] - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/ oak-core/src/main/java/org/apache/jackrabbit/oak/osgi/ oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/ oak-core/src/main/java/org/a...
Date Thu, 25 Apr 2013 13:20:24 GMT
Modified: jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/TestUtils.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/TestUtils.java?rev=1475754&r1=1475753&r2=1475754&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/TestUtils.java
(original)
+++ jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/TestUtils.java
Thu Apr 25 13:20:23 2013
@@ -19,14 +19,16 @@ package org.apache.jackrabbit.oak.plugin
 import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
+
+import javax.annotation.CheckForNull;
 import javax.annotation.Nonnull;
 
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.plugins.index.IndexDefinition;
-import org.apache.jackrabbit.oak.plugins.index.IndexHook;
-import org.apache.jackrabbit.oak.plugins.index.IndexHookProvider;
+import org.apache.jackrabbit.oak.plugins.index.IndexEditorProvider;
 import org.apache.jackrabbit.oak.plugins.index.solr.index.SolrIndexDiff;
 import org.apache.jackrabbit.oak.plugins.index.solr.query.SolrQueryIndex;
+import org.apache.jackrabbit.oak.spi.commit.Editor;
 import org.apache.jackrabbit.oak.spi.query.Filter;
 import org.apache.jackrabbit.oak.spi.query.QueryIndex;
 import org.apache.jackrabbit.oak.spi.query.QueryIndexProvider;
@@ -36,8 +38,6 @@ import org.apache.solr.client.solrj.Solr
 import org.apache.solr.client.solrj.embedded.EmbeddedSolrServer;
 import org.apache.solr.core.CoreContainer;
 
-import com.google.common.collect.ImmutableList;
-
 import static org.apache.jackrabbit.oak.plugins.index.IndexUtils.buildIndexDefinitions;
 
 /**
@@ -67,21 +67,18 @@ public class TestUtils {
         };
     }
 
-    public static IndexHookProvider getTestIndexHookProvider(final SolrServer solrServer,
final OakSolrConfiguration configuration) {
-        return new IndexHookProvider() {
-            @Nonnull
-            @Override
-            public List<? extends IndexHook> getIndexHooks(
-                    String s, NodeBuilder nodeBuilder, NodeState root) {
-                if (SolrQueryIndex.TYPE.equals(s)) {
+    public static IndexEditorProvider getTestIndexHookProvider(final SolrServer solrServer,
final OakSolrConfiguration configuration) {
+        return new IndexEditorProvider() {
+            @Override @CheckForNull
+            public Editor getIndexEditor(String type, NodeBuilder builder) {
+                if (SolrQueryIndex.TYPE.equals(type)) {
                     try {
-                        IndexHook indexHook = new SolrIndexDiff(nodeBuilder, solrServer,
configuration);
-                        return ImmutableList.of(indexHook);
+                        return new SolrIndexDiff(builder, solrServer, configuration);
                     } catch (Exception e) {
                         throw new RuntimeException(e);
                     }
                 }
-                return ImmutableList.of();
+                return null;
             }
         };
 



Mime
View raw message