Hi,
I've just given a try to ElasticsearchIntegrationTest as I used to create
my own local node with some pre-seeded data
It seems nice but I'm unable to reproduce what I had setting up my own node.
I've defined my PluginTest class as following:
@ClusterScope(scope = Scope.SUITE)
public class PluginTest extends ElasticsearchIntegrationTest {
...
}
I use to have a singleton that seeded my data upong @BeforeClass. It seems
I can't do that anymore because no cluster is available after
ElasticsearchIntegrationTest.beforeClass()
It only becomes available in @Before.
The documentation of ElasticsearchIntegrationTest
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/integration-tests.html did
not really help me to define how I would manage test seeds.
I've tried to store the client and seed the data once based on a static
variable in my @Before like this:
private static Injector injector;
private static Plugin action;
private static TestClient esClient;
@Before
public void beforePluginTest() {
if (injector == null) {
injector = Guice.createInjector(new TestModule(client())); // this is the
google guice injector, not the es one
esClient = injector.getInstance(TestClient.class); // this seeds the data
and gives some helper methods
action = injector.getInstance(Plugin.class); // this is my plugin
}
}
But then i get the following error for some tests:
org.elasticsearch.client.transport.NoNodeAvailableException: None of the
configured nodes are available: []
I also see that for each test, nodes are started/stopped which takes an
awful lot of time. I would like only one local node in which I seed my data
once. I could then i execute all my tests and uppon completion of those the
node and it's data are closed / destroyed.
Does anyone have some pointers to help me on this ?
Thanks
Regards,
Laurent
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/3664831f-17d0-4b89-bee2-48abe563e390%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.