import org.junit.runner.Description;
import org.junit.runner.Result;
import org.junit.runner.notification.Failure;
import org.junit.runner.notification.RunListener;
import org.jacoco.agent.rt.RT;
import org.jacoco.agent.rt.IAgent;


public class TacocoListener extends RunListener
{
	private IAgent agent;

	public void testRunStarted(Description description)
	{
		System.out.println("Number of test cases to execute: " + description.testCount());
		agent = RT.getAgent();
	}

	public void testRunFinished(Result result)
	{
		System.out.println("Number of test cases executed: " + result.getRunCount());
		agent.setSessionId("end");
	}

	public void testStarted(Description description)
	{
		System.out.println("Test case started.");
		System.out.println("Setting sessionId to "+description.getDisplayName());
		agent.setSessionId(description.getDisplayName());
	}
	public void testFinished(Description description) throws java.lang.Exception
	{
		int sleepLength = 1000;
		System.out.println("Test case finished.");
		agent.dump(true);
		System.out.println("Going to sleep for "+sleepLength+" ms.");
		System.out.flush();
		Thread.sleep(sleepLength);
		System.out.println("Done sleeping.");
		System.out.flush();
		Thread.sleep(1000);

	}
}

@@ -961,18 +961,16 @@
 gth = 10
-00
 ;%0A%09%09Syst
@@ -1222,18 +1222,16 @@
 sleep(10
-00
 );%0A%0A%09%7D%0A%7D

Update TacocoListener.java