for ( int i = 0; i < rerunFailingTestsCount && !testFailureListener.getAllFailures().isEmpty(); i++ )
{
Map<Class<?>, Set<String>> failingTests =
JUnit4ProviderUtil.generateFailingTests( testFailureListener.getAllFailures(), testsToRun );
testFailureListener.reset();
final FilterFactory filterFactory = new FilterFactory( testClassLoader );
Filter failingMethodsFilter = filterFactory.createFailingMethodFilter( failingTests );
JUnitCoreWrapper.execute( testsToRun, jUnitCoreParameters, customRunListeners,
filterFactory.and( filter, failingMethodsFilter ) );
}
}
return reporterFactory.close();
}