package my.package;
import org.junit.internal.runners.InitializationError;
import org.junit.internal.runners.TestClassRunner;
import org.junit.runner.Description;
import org.junit.runner.Runner;
import org.junit.runner.notification.RunListener;
import org.junit.runner.notification.RunNotifier;
public class MyRunner extends TestClassRunner {
private static class MyListener extends RunListener {
@Override
public void testStarted(Description description) throws Exception { System.err.println(" STARTED: " + description.getDisplayName());
}
@Override
public void testFinished(Description description) throws Exception {
System.err.println("FINISHED: " + description.getDisplayName());
}
}
public synchronized void run(final RunNotifier notifier) {
notifier.addListener(new MyListener()); super.run(notifier);
}
public MyRunner(Class<?> klass) throws InitializationError {
super(klass);
}
public MyRunner(Class<?> klass, Runner runner) throws InitializationError {
super(klass, runner);
}
}