[qa] Add smoke test client module

Fix previous commit. A `pom` project does not run any test...
And the cluster name is set externally so we can't assert that it's `elasticsearch`.
This commit is contained in:
David Pilato 2015-09-02 19:27:52 +02:00
parent d47857b66f
commit 1ffc6cd6a7
2 changed files with 4 additions and 2 deletions

View File

@ -21,7 +21,6 @@
<artifactId>smoke-test-client</artifactId> <artifactId>smoke-test-client</artifactId>
<name>QA: Smoke Test Client</name> <name>QA: Smoke Test Client</name>
<description>Test the Java Client against a running cluster</description> <description>Test the Java Client against a running cluster</description>
<packaging>pom</packaging>
<properties> <properties>
<skip.unit.tests>true</skip.unit.tests> <skip.unit.tests>true</skip.unit.tests>

View File

@ -25,6 +25,7 @@ import org.elasticsearch.client.Client;
import org.junit.Test; import org.junit.Test;
import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.Matchers.greaterThan;
public class SmokeTestClientIT extends ESSmokeClientTestCase { public class SmokeTestClientIT extends ESSmokeClientTestCase {
@ -37,8 +38,10 @@ public class SmokeTestClientIT extends ESSmokeClientTestCase {
// START SNIPPET: java-doc-admin-cluster-health // START SNIPPET: java-doc-admin-cluster-health
ClusterHealthResponse health = client.admin().cluster().prepareHealth().setWaitForYellowStatus().get(); ClusterHealthResponse health = client.admin().cluster().prepareHealth().setWaitForYellowStatus().get();
String clusterName = health.getClusterName();
int numberOfNodes = health.getNumberOfNodes();
// END SNIPPET: java-doc-admin-cluster-health // END SNIPPET: java-doc-admin-cluster-health
assertThat(health.getClusterName(), is("elasticsearch")); assertThat("cluster [" + clusterName + "] should have at least 1 node", numberOfNodes, greaterThan(0));
} }
/** /**