use of org.junit.runner.notification.RunListener in project drools-wb by kiegroup.
the class ScenarioRunnerService method run.
private TestResultMessage run(final String identifier, final Path path, final ScenarioRunner4JUnit scenarioRunner) {
final List<org.guvnor.common.services.shared.test.Failure> failures = new ArrayList<org.guvnor.common.services.shared.test.Failure>();
final JUnitCore jUnitCore = new JUnitCore();
jUnitCore.addListener(new RunListener() {
@Override
public void testAssumptionFailure(Failure failure) {
failures.add(failureToFailure(path, failure));
}
});
final Result result = jUnitCore.run(scenarioRunner);
failures.addAll(failuresToFailures(path, result.getFailures()));
return new TestResultMessage(identifier, result.getRunCount(), result.getRunTime(), failures);
}
Aggregations