From 55feae1e9a9fa047de9caf35cbab991569237e04 Mon Sep 17 00:00:00 2001 From: javanna Date: Wed, 21 Dec 2016 13:28:43 +0100 Subject: [PATCH 1/2] [TEST] remove deleted test classes from checkstyle suppressions Relates to #21915 --- buildSrc/src/main/resources/checkstyle_suppressions.xml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/buildSrc/src/main/resources/checkstyle_suppressions.xml b/buildSrc/src/main/resources/checkstyle_suppressions.xml index 02097315eaa..91ac28441e7 100644 --- a/buildSrc/src/main/resources/checkstyle_suppressions.xml +++ b/buildSrc/src/main/resources/checkstyle_suppressions.xml @@ -590,9 +590,6 @@ - - - @@ -704,7 +701,6 @@ - @@ -923,7 +919,6 @@ - @@ -994,7 +989,6 @@ - From 7141f6b554559a1d7bb52732ce62fb63240a4004 Mon Sep 17 00:00:00 2001 From: javanna Date: Wed, 21 Dec 2016 13:31:02 +0100 Subject: [PATCH 2/2] [TEST] improve error message in ESTestCase#assertWarnings --- .../src/main/java/org/elasticsearch/test/ESTestCase.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/framework/src/main/java/org/elasticsearch/test/ESTestCase.java b/test/framework/src/main/java/org/elasticsearch/test/ESTestCase.java index 9a198ade50a..bcfad66ef59 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/ESTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/test/ESTestCase.java @@ -29,7 +29,6 @@ import com.carrotsearch.randomizedtesting.generators.RandomNumbers; import com.carrotsearch.randomizedtesting.generators.RandomPicks; import com.carrotsearch.randomizedtesting.generators.RandomStrings; import com.carrotsearch.randomizedtesting.rules.TestRuleAdapter; - import org.apache.logging.log4j.Level; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -63,9 +62,9 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.common.util.MockBigArrays; import org.elasticsearch.common.util.MockPageCacheRecycler; +import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentParser; @@ -133,7 +132,6 @@ import static org.elasticsearch.common.util.CollectionUtils.arrayAsArrayList; import static org.hamcrest.Matchers.empty; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasItem; -import static org.hamcrest.Matchers.hasSize; /** * Base testcase for randomized unit testing with Elasticsearch @@ -300,7 +298,9 @@ public abstract class ESTestCase extends LuceneTestCase { } try { final List actualWarnings = threadContext.getResponseHeaders().get(DeprecationLogger.WARNING_HEADER); - assertThat(actualWarnings, hasSize(expectedWarnings.length)); + assertEquals("Expected " + expectedWarnings.length + " warnings but found " + actualWarnings.size() + "\nExpected: " + + Arrays.asList(expectedWarnings) + "\nActual: " + actualWarnings, + expectedWarnings.length, actualWarnings.size()); for (String msg : expectedWarnings) { assertThat(actualWarnings, hasItem(equalTo(msg))); }