From: Alexandre Montplaisir Date: Thu, 30 Jul 2015 20:23:00 +0000 (-0400) Subject: Detach the test name printing listener after the test is run X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=ebb26270dba5ada0a095f2889eee1cb808a69de2;p=lttng-ust-java-tests.git Detach the test name printing listener after the test is run Or else they keep piling up, and the message "Now running test XYZ" is displayed several times. --- diff --git a/src/test/java/org/lttng/ust/agent/utils/TestPrintRunner.java b/src/test/java/org/lttng/ust/agent/utils/TestPrintRunner.java index 4a38b74..2881067 100644 --- a/src/test/java/org/lttng/ust/agent/utils/TestPrintRunner.java +++ b/src/test/java/org/lttng/ust/agent/utils/TestPrintRunner.java @@ -46,8 +46,11 @@ public class TestPrintRunner extends BlockJUnit4ClassRunner { @Override public void run(RunNotifier notifier) { - notifier.addListener(new TestPrintListener()); + RunListener listener = new TestPrintListener(); + + notifier.addListener(listener); super.run(notifier); + notifier.removeListener(listener); } /**