private CountingRunListener runTestWithParentRunner(Class<?> testClass) throws InitializationError {
CountingRunListener listener = new CountingRunListener();
RunNotifier runNotifier = new RunNotifier();
runNotifier.addListener(listener);
ParentRunner runner = new BlockJUnit4ClassRunner(testClass);
runner.run(runNotifier);
return listener;
}
private static class CountingRunListener extends RunListener {
private int testStarted = 0;