# How to use ESIntegTestCase to load plugins in elasticsearch 5.6.3?

**URL:** <https://discuss.elastic.co/t/how-to-use-esintegtestcase-to-load-plugins-in-elasticsearch-5-6-3/104807>\
**Category:** Elasticsearch\
**Created:** [October 22, 2017, 4:04pm UTC](https://discuss.elastic.co/t/how-to-use-esintegtestcase-to-load-plugins-in-elasticsearch-5-6-3/104807 "2017-10-22T16:04:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tavandung12](https://avatars.discourse-cdn.com/v4/letter/t/d2c977/32.png) [@tavandung12](https://discuss.elastic.co/u/tavandung12)\
**Post date:** [October 22, 2017, 4:04pm UTC](https://discuss.elastic.co/t/how-to-use-esintegtestcase-to-load-plugins-in-elasticsearch-5-6-3/104807/1 "2017-10-22T16:04:09Z")

</div>

here is my source code:

```java
@ClusterScope(scope = Scope.SUITE)
public class MyExpertScriptEngineTest extends ESIntegTestCase {
	
	public MyExpertScriptEngineTest() {
		System.setProperty(TESTS_CLUSTER, "localhost:9300");
		System.setProperty("tests.rest.cluster", "localhost:9200");
	}
	
	@Override
    protected Collection<Class<? extends Plugin>> nodePlugins() {
        return Collections.singleton(ExamplePlugin.class);
    }
}

```

I see that, `nodePlugins` didn't fire.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [October 23, 2017, 8:31am UTC](https://discuss.elastic.co/t/how-to-use-esintegtestcase-to-load-plugins-in-elasticsearch-5-6-3/104807/2 "2017-10-23T08:31:46Z")

</div>

Hey,

this looks good from a quick check, we do the same in our tests, except with the CTOR, that should be put into a before method or handed in via properties on the command line.

Keep in mind, that ES starts on other than the default ports. Showing the logs from the test might be very useful in a gist.

--Alex

---

<div class="post-metadata">

**Author:** ![tavandung12](https://avatars.discourse-cdn.com/v4/letter/t/d2c977/32.png) [@tavandung12](https://discuss.elastic.co/u/tavandung12)\
**Post date:** [October 23, 2017, 8:47am UTC](https://discuss.elastic.co/t/how-to-use-esintegtestcase-to-load-plugins-in-elasticsearch-5-6-3/104807/3 "2017-10-23T08:47:10Z")

</div>

Hi @spinscale,

Can you take a look my test case?

> <https://github.com/tvd12/elasticsearch-simple-plugin/blob/master/src/test/java/org/elasticsearch/plugin/example/testing/MyExpertScriptEngineTest.java>

Here is stacktrace:

```java
java.lang.IllegalArgumentException: no hosts provided
	at __randomizedtesting.SeedInfo.seed([FB7A456648DB37AC:E8E928B8F26BEDEF]:0)
	at org.elasticsearch.client.RestClientBuilder.<init>(RestClientBuilder.java:67)
	at org.elasticsearch.client.RestClient.builder(RestClient.java:117)
	at org.elasticsearch.test.ESIntegTestCase.createRestClient(ESIntegTestCase.java:2200)
	at org.elasticsearch.test.ESIntegTestCase.createRestClient(ESIntegTestCase.java:2184)
	at org.elasticsearch.test.ESIntegTestCase.getRestClient(ESIntegTestCase.java:2178)
	at org.elasticsearch.plugin.example.testing.MyExpertScriptEngineTest.testSimulateProcessor(MyExpertScriptEngineTest.java:82)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(RandomizedRunner.java:1737)
	at com.carrotsearch.randomizedtesting.RandomizedRunner$8.evaluate(RandomizedRunner.java:934)
	at com.carrotsearch.randomizedtesting.RandomizedRunner$9.evaluate(RandomizedRunner.java:970)
	at com.carrotsearch.randomizedtesting.RandomizedRunner$10.evaluate(RandomizedRunner.java:984)
	at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
	at org.apache.lucene.util.TestRuleSetupTeardownChained$1.evaluate(TestRuleSetupTeardownChained.java:49)
	at org.apache.lucene.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:45)
	at org.apache.lucene.util.TestRuleThreadAndTestName$1.evaluate(TestRuleThreadAndTestName.java:48)
	at org.apache.lucene.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:64)
	at org.apache.lucene.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:47)
	at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
	at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:368)
	at com.carrotsearch.randomizedtesting.ThreadLeakControl.forkTimeoutingTask(ThreadLeakControl.java:817)
	at com.carrotsearch.randomizedtesting.ThreadLeakControl$3.evaluate(ThreadLeakControl.java:468)
	at com.carrotsearch.randomizedtesting.RandomizedRunner.runSingleTest(RandomizedRunner.java:943)
	at com.carrotsearch.randomizedtesting.RandomizedRunner$5.evaluate(RandomizedRunner.java:829)
	at com.carrotsearch.randomizedtesting.RandomizedRunner$6.evaluate(RandomizedRunner.java:879)
	at com.carrotsearch.randomizedtesting.RandomizedRunner$7.evaluate(RandomizedRunner.java:890)
	at org.apache.lucene.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:45)
	at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
	at org.apache.lucene.util.TestRuleStoreClassName$1.evaluate(TestRuleStoreClassName.java:41)
	at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
	at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
	at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
	at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
	at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
	at org.apache.lucene.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:53)
	at org.apache.lucene.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:47)
	at org.apache.lucene.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:64)
	at org.apache.lucene.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:54)
	at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
	at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:368)
	at java.lang.Thread.run(Thread.java:745)

```

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [October 23, 2017, 8:50am UTC](https://discuss.elastic.co/t/how-to-use-esintegtestcase-to-load-plugins-in-elasticsearch-5-6-3/104807/4 "2017-10-23T08:50:45Z")

</div>

the problem is not plugin loading, but the rest client initialization

---

<div class="post-metadata">

**Author:** ![tavandung12](https://avatars.discourse-cdn.com/v4/letter/t/d2c977/32.png) [@tavandung12](https://discuss.elastic.co/u/tavandung12)\
**Post date:** [October 23, 2017, 8:54am UTC](https://discuss.elastic.co/t/how-to-use-esintegtestcase-to-load-plugins-in-elasticsearch-5-6-3/104807/5 "2017-10-23T08:54:04Z")

</div>

So, what's exactly mean of:

```java
@Override
	protected boolean ignoreExternalCluster() {
		return true;
	}
	
	@Override
	protected Collection<Class<? extends Plugin>> transportClientPlugins() {
		return Collections.singleton(ExamplePlugin.class);
	}
	
	@Override
    protected Collection<Class<? extends Plugin>> nodePlugins() {
        return Collections.singleton(ExamplePlugin.class);
    }

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 20, 2017, 8:54am UTC](https://discuss.elastic.co/t/how-to-use-esintegtestcase-to-load-plugins-in-elasticsearch-5-6-3/104807/6 "2017-11-20T08:54:05Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
