Remove line-length violations in SmokeTestClientIT

This commit removes the line-length violations in SmokeTestClientIT.java
and removes this file from the list of suppressions.
This commit is contained in:
Jason Tedor 2017-03-27 19:59:48 -04:00
parent 7930dcad89
commit 6b461a1458
2 changed files with 11 additions and 8 deletions

View File

@ -3947,7 +3947,6 @@
<suppress files="qa[/\\]evil-tests[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]plugins[/\\]RemovePluginCommandTests.java" checks="LineLength" />
<suppress files="qa[/\\]evil-tests[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]tribe[/\\]TribeUnitTests.java" checks="LineLength" />
<suppress files="qa[/\\]smoke-test-client[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]smoketest[/\\]ESSmokeClientTestCase.java" checks="LineLength" />
<suppress files="qa[/\\]smoke-test-client[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]smoketest[/\\]SmokeTestClientIT.java" checks="LineLength" />
<suppress files="qa[/\\]smoke-test-http[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]http[/\\]ContextAndHeaderTransportIT.java" checks="LineLength" />
<suppress files="qa[/\\]smoke-test-http[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]http[/\\]CorsRegexIT.java" checks="LineLength" />
<suppress files="qa[/\\]smoke-test-http[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]http[/\\]DeprecationHttpIT.java" checks="LineLength" />

View File

@ -32,21 +32,25 @@ public class SmokeTestClientIT extends ESSmokeClientTestCase {
* Check that we are connected to a cluster named "elasticsearch".
*/
public void testSimpleClient() {
Client client = getClient();
final Client client = getClient();
// START SNIPPET: java-doc-admin-cluster-health
ClusterHealthResponse health = client.admin().cluster().prepareHealth().setWaitForYellowStatus().get();
String clusterName = health.getClusterName();
int numberOfNodes = health.getNumberOfNodes();
final ClusterHealthResponse health =
client.admin().cluster().prepareHealth().setWaitForYellowStatus().get();
final String clusterName = health.getClusterName();
final int numberOfNodes = health.getNumberOfNodes();
// END SNIPPET: java-doc-admin-cluster-health
assertThat("cluster [" + clusterName + "] should have at least 1 node", numberOfNodes, greaterThan(0));
assertThat(
"cluster [" + clusterName + "] should have at least 1 node",
numberOfNodes,
greaterThan(0));
}
/**
* Create an index and index some docs
*/
public void testPutDocument() {
Client client = getClient();
final Client client = getClient();
// START SNIPPET: java-doc-index-doc-simple
client.prepareIndex(index, "doc", "1") // Index, Type, Id
@ -60,7 +64,7 @@ public class SmokeTestClientIT extends ESSmokeClientTestCase {
// END SNIPPET: java-doc-admin-indices-refresh
// START SNIPPET: java-doc-search-simple
SearchResponse searchResponse = client.prepareSearch(index).get();
final SearchResponse searchResponse = client.prepareSearch(index).get();
assertThat(searchResponse.getHits().getTotalHits(), is(1L));
// END SNIPPET: java-doc-search-simple
}