From 6b8dd0b08f921bd0c39888a875ca2832dbda9167 Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Tue, 27 Aug 2013 11:50:04 +0200 Subject: [PATCH] Added log info on test finished --- .../junit/listerners/ReproduceInfoPrinter.java | 7 ++++++- .../integration/ElasticSearchTokenStreamTestCase.java | 8 +++++--- .../test/integration/ElasticsearchLuceneTestCase.java | 8 +++++--- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/test/java/org/elasticsearch/junit/listerners/ReproduceInfoPrinter.java b/src/test/java/org/elasticsearch/junit/listerners/ReproduceInfoPrinter.java index f709c155d50..fa312b27974 100644 --- a/src/test/java/org/elasticsearch/junit/listerners/ReproduceInfoPrinter.java +++ b/src/test/java/org/elasticsearch/junit/listerners/ReproduceInfoPrinter.java @@ -13,7 +13,7 @@ import org.junit.runner.notification.RunListener; /** * A {@link RunListener} that emits to {@link System#err} a string with command - * line parameters allowing quick test re-run under ANT command line. + * line parameters allowing quick test re-run under MVN command line. */ public class ReproduceInfoPrinter extends RunListener { @@ -24,6 +24,11 @@ public class ReproduceInfoPrinter extends RunListener { logger.info("Test {} started", description.getDisplayName()); } + @Override + public void testFinished(Description description) throws Exception { + logger.info("Test {} finished", description.getDisplayName()); + } + @Override public void testFailure(Failure failure) throws Exception { // Ignore assumptions. diff --git a/src/test/java/org/elasticsearch/test/integration/ElasticSearchTokenStreamTestCase.java b/src/test/java/org/elasticsearch/test/integration/ElasticSearchTokenStreamTestCase.java index 4ab2ecb9f32..3e2265f5e41 100644 --- a/src/test/java/org/elasticsearch/test/integration/ElasticSearchTokenStreamTestCase.java +++ b/src/test/java/org/elasticsearch/test/integration/ElasticSearchTokenStreamTestCase.java @@ -19,13 +19,15 @@ package org.elasticsearch.test.integration; -import com.carrotsearch.randomizedtesting.annotations.ThreadLeakFilters; -import com.carrotsearch.randomizedtesting.annotations.ThreadLeakScope; +import com.carrotsearch.randomizedtesting.annotations.*; import com.carrotsearch.randomizedtesting.annotations.ThreadLeakScope.Scope; -import com.carrotsearch.randomizedtesting.annotations.TimeoutSuite; import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.util.TimeUnits; +import org.elasticsearch.junit.listerners.ReproduceInfoPrinter; +@Listeners({ + ReproduceInfoPrinter.class +}) @ThreadLeakFilters(defaultFilters = true, filters = {ElasticSearchThreadFilter.class}) @ThreadLeakScope(Scope.NONE) @TimeoutSuite(millis = TimeUnits.HOUR) diff --git a/src/test/java/org/elasticsearch/test/integration/ElasticsearchLuceneTestCase.java b/src/test/java/org/elasticsearch/test/integration/ElasticsearchLuceneTestCase.java index 726d2808b8b..551ec97852f 100644 --- a/src/test/java/org/elasticsearch/test/integration/ElasticsearchLuceneTestCase.java +++ b/src/test/java/org/elasticsearch/test/integration/ElasticsearchLuceneTestCase.java @@ -19,14 +19,16 @@ package org.elasticsearch.test.integration; -import com.carrotsearch.randomizedtesting.annotations.ThreadLeakFilters; -import com.carrotsearch.randomizedtesting.annotations.ThreadLeakScope; +import com.carrotsearch.randomizedtesting.annotations.*; import com.carrotsearch.randomizedtesting.annotations.ThreadLeakScope.Scope; -import com.carrotsearch.randomizedtesting.annotations.TimeoutSuite; import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; import org.apache.lucene.util.TimeUnits; +import org.elasticsearch.junit.listerners.ReproduceInfoPrinter; +@Listeners({ + ReproduceInfoPrinter.class +}) @ThreadLeakFilters(defaultFilters = true, filters = {ElasticSearchThreadFilter.class}) @ThreadLeakScope(Scope.NONE) @TimeoutSuite(millis = TimeUnits.HOUR)