From 4700cb94097945d3a0087c6746746d662ea27f3e Mon Sep 17 00:00:00 2001 From: Zachary Tong Date: Fri, 18 Dec 2015 15:16:51 -0500 Subject: [TEST] Check length of profiled results in tests --- .../java/org/elasticsearch/search/profile/QueryProfilerIT.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'core/src/test/java/org/elasticsearch/search/profile') diff --git a/core/src/test/java/org/elasticsearch/search/profile/QueryProfilerIT.java b/core/src/test/java/org/elasticsearch/search/profile/QueryProfilerIT.java index bb33364a75..22772ff4a1 100644 --- a/core/src/test/java/org/elasticsearch/search/profile/QueryProfilerIT.java +++ b/core/src/test/java/org/elasticsearch/search/profile/QueryProfilerIT.java @@ -73,6 +73,7 @@ public class QueryProfilerIT extends ESIntegTestCase { .execute().actionGet(); assertNotNull("Profile response element should not be null", resp.getProfileResults()); + assertThat("Profile response should not be an empty array", resp.getProfileResults().size(), not(0)); for (Map.Entry> shard : resp.getProfileResults().entrySet()) { for (ProfileShardResult searchProfiles : shard.getValue()) { for (ProfileResult result : searchProfiles.getQueryResults()) { @@ -195,6 +196,7 @@ public class QueryProfilerIT extends ESIntegTestCase { Map> p = resp.getProfileResults(); assertNotNull(p); + assertThat("Profile response should not be an empty array", resp.getProfileResults().size(), not(0)); for (Map.Entry> shardResult : resp.getProfileResults().entrySet()) { for (ProfileShardResult searchProfiles : shardResult.getValue()) { @@ -240,6 +242,7 @@ public class QueryProfilerIT extends ESIntegTestCase { Map> p = resp.getProfileResults(); assertNotNull(p); + assertThat("Profile response should not be an empty array", resp.getProfileResults().size(), not(0)); for (Map.Entry> shardResult : resp.getProfileResults().entrySet()) { for (ProfileShardResult searchProfiles : shardResult.getValue()) { @@ -307,6 +310,7 @@ public class QueryProfilerIT extends ESIntegTestCase { .execute().actionGet(); assertNotNull("Profile response element should not be null", resp.getProfileResults()); + assertThat("Profile response should not be an empty array", resp.getProfileResults().size(), not(0)); for (Map.Entry> shardResult : resp.getProfileResults().entrySet()) { for (ProfileShardResult searchProfiles : shardResult.getValue()) { @@ -358,6 +362,7 @@ public class QueryProfilerIT extends ESIntegTestCase { .execute().actionGet(); assertNotNull("Profile response element should not be null", resp.getProfileResults()); + assertThat("Profile response should not be an empty array", resp.getProfileResults().size(), not(0)); for (Map.Entry> shardResult : resp.getProfileResults().entrySet()) { for (ProfileShardResult searchProfiles : shardResult.getValue()) { @@ -404,6 +409,7 @@ public class QueryProfilerIT extends ESIntegTestCase { .execute().actionGet(); assertNotNull("Profile response element should not be null", resp.getProfileResults()); + assertThat("Profile response should not be an empty array", resp.getProfileResults().size(), not(0)); for (Map.Entry> shardResult : resp.getProfileResults().entrySet()) { for (ProfileShardResult searchProfiles : shardResult.getValue()) { @@ -450,6 +456,7 @@ public class QueryProfilerIT extends ESIntegTestCase { .execute().actionGet(); assertNotNull("Profile response element should not be null", resp.getProfileResults()); + assertThat("Profile response should not be an empty array", resp.getProfileResults().size(), not(0)); for (Map.Entry> shardResult : resp.getProfileResults().entrySet()) { for (ProfileShardResult searchProfiles : shardResult.getValue()) { @@ -495,6 +502,7 @@ public class QueryProfilerIT extends ESIntegTestCase { .execute().actionGet(); assertNotNull("Profile response element should not be null", resp.getProfileResults()); + assertThat("Profile response should not be an empty array", resp.getProfileResults().size(), not(0)); for (Map.Entry> shardResult : resp.getProfileResults().entrySet()) { for (ProfileShardResult searchProfiles : shardResult.getValue()) { @@ -549,6 +557,7 @@ public class QueryProfilerIT extends ESIntegTestCase { } assertNotNull("Profile response element should not be null", resp.getProfileResults()); + assertThat("Profile response should not be an empty array", resp.getProfileResults().size(), not(0)); for (Map.Entry> shardResult : resp.getProfileResults().entrySet()) { for (ProfileShardResult searchProfiles : shardResult.getValue()) { -- cgit v1.2.3