diff options
author | Ryan Ernst <ryan@iernst.net> | 2015-08-22 00:21:13 -0700 |
---|---|---|
committer | Ryan Ernst <ryan@iernst.net> | 2015-08-22 01:37:43 -0700 |
commit | 89e1a0fb7dd6227fb1d74d51644da7a52c3f7055 (patch) | |
tree | 845af82232e9777efd9f667da0642e9b7adea372 /core/src/test/java/org/elasticsearch/action/IndicesRequestIT.java | |
parent | 980f49b56698a34dedf16ed4364b0775c469d7ad (diff) |
Plugins: Removed plugin.types
The setting `plugin.types` is currently used to load plugins from the
classpath. This is necessary in tests, as well as the transport client.
This change removes the setting, and replaces it with the ability to
directly add plugins when building a transport client, as well as
infrastructure in the integration tests to specify which plugin classes
should be loaded on each node.
Diffstat (limited to 'core/src/test/java/org/elasticsearch/action/IndicesRequestIT.java')
-rw-r--r-- | core/src/test/java/org/elasticsearch/action/IndicesRequestIT.java | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/core/src/test/java/org/elasticsearch/action/IndicesRequestIT.java b/core/src/test/java/org/elasticsearch/action/IndicesRequestIT.java index 10b3449333..dd31d4f352 100644 --- a/core/src/test/java/org/elasticsearch/action/IndicesRequestIT.java +++ b/core/src/test/java/org/elasticsearch/action/IndicesRequestIT.java @@ -95,6 +95,7 @@ import org.elasticsearch.search.action.SearchServiceTransportAction; import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.elasticsearch.test.ESIntegTestCase.Scope; +import org.elasticsearch.test.transport.MockTransportService; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.Transport; import org.elasticsearch.transport.TransportChannel; @@ -107,6 +108,7 @@ import org.junit.Before; import org.junit.Test; import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; @@ -141,11 +143,15 @@ public class IndicesRequestIT extends ESIntegTestCase { } @Override - protected Settings nodeSettings(int nodeOrdinal) { - return Settings.settingsBuilder() - .put(super.nodeSettings(nodeOrdinal)) - .extendArray("plugin.types", InterceptingTransportService.TestPlugin.class.getName()) - .build(); + protected Settings nodeSettings(int ordinal) { + // must set this independently of the plugin so it overrides MockTransportService + return Settings.builder().put(super.nodeSettings(ordinal)) + .put(TransportModule.TRANSPORT_SERVICE_TYPE_KEY, "intercepting").build(); + } + + @Override + protected Collection<Class<? extends Plugin>> nodePlugins() { + return pluginList(InterceptingTransportService.TestPlugin.class); } @Before @@ -856,10 +862,6 @@ public class IndicesRequestIT extends ESIntegTestCase { public void onModule(TransportModule transportModule) { transportModule.addTransportService("intercepting", InterceptingTransportService.class); } - @Override - public Settings additionalSettings() { - return Settings.builder().put(TransportModule.TRANSPORT_SERVICE_TYPE_KEY, "intercepting").build(); - } } private final Set<String> actions = new HashSet<>(); |