From ebb26270dba5ada0a095f2889eee1cb808a69de2 Mon Sep 17 00:00:00 2001 From: Alexandre Montplaisir Date: Thu, 30 Jul 2015 16:23:00 -0400 Subject: [PATCH] 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. --- src/test/java/org/lttng/ust/agent/utils/TestPrintRunner.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); } /** -- 2.34.1