Detach the test name printing listener after the test is run
authorAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Thu, 30 Jul 2015 20:23:00 +0000 (16:23 -0400)
committerAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Thu, 30 Jul 2015 20:23:00 +0000 (16:23 -0400)
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

index 4a38b7453e28574b4d204b4a0ab5c3e4105ab8ff..28810678b2980a04db5a60c0ba7ff89e813b835e 100644 (file)
@@ -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);
     }
 
     /**
This page took 0.022823 seconds and 4 git commands to generate.