@Test public void runWithJunitTest() { List<Failure> failures = new ArrayList<>(); List<Failure> failureDetails = new ArrayList<>(); Path path = mock(Path.class); Result result = runWithJunit(path, fakeRunner, failures, failureDetails); assertFalse(result.wasSuccessful()); assertEquals(1, failures.size()); assertEquals(2, failureDetails.size()); assertEquals("Test", failures.get(0).getMessage()); assertEquals(path, failures.get(0).getPath()); }
public static Result runWithJunit(Path path, Runner runner, List<Failure> failures, List<Failure> failureDetails) { JUnitCore jUnitCore = new JUnitCore(); jUnitCore.addListener(new RunListener() { @Override public void testAssumptionFailure(org.junit.runner.notification.Failure failure) { failureDetails.add(failureToFailure(path, failure)); } }); Result result = jUnitCore.run(runner); failures.addAll(failuresToFailures(path, result.getFailures())); return result; }
JunitRunnerHelper { public static Result runWithJunit(Path path, Runner runner, List<Failure> failures, List<Failure> failureDetails) { JUnitCore jUnitCore = new JUnitCore(); jUnitCore.addListener(new RunListener() { @Override public void testAssumptionFailure(org.junit.runner.notification.Failure failure) { failureDetails.add(failureToFailure(path, failure)); } }); Result result = jUnitCore.run(runner); failures.addAll(failuresToFailures(path, result.getFailures())); return result; } }
JunitRunnerHelper { public static Result runWithJunit(Path path, Runner runner, List<Failure> failures, List<Failure> failureDetails) { JUnitCore jUnitCore = new JUnitCore(); jUnitCore.addListener(new RunListener() { @Override public void testAssumptionFailure(org.junit.runner.notification.Failure failure) { failureDetails.add(failureToFailure(path, failure)); } }); Result result = jUnitCore.run(runner); failures.addAll(failuresToFailures(path, result.getFailures())); return result; }  }
JunitRunnerHelper { public static Result runWithJunit(Path path, Runner runner, List<Failure> failures, List<Failure> failureDetails) { JUnitCore jUnitCore = new JUnitCore(); jUnitCore.addListener(new RunListener() { @Override public void testAssumptionFailure(org.junit.runner.notification.Failure failure) { failureDetails.add(failureToFailure(path, failure)); } }); Result result = jUnitCore.run(runner); failures.addAll(failuresToFailures(path, result.getFailures())); return result; }  static Result runWithJunit(Path path,
                                      Runner runner,
                                      List<Failure> failures,
                                      List<Failure> failureDetails); }
JunitRunnerHelper { public static Result runWithJunit(Path path, Runner runner, List<Failure> failures, List<Failure> failureDetails) { JUnitCore jUnitCore = new JUnitCore(); jUnitCore.addListener(new RunListener() { @Override public void testAssumptionFailure(org.junit.runner.notification.Failure failure) { failureDetails.add(failureToFailure(path, failure)); } }); Result result = jUnitCore.run(runner); failures.addAll(failuresToFailures(path, result.getFailures())); return result; }  static Result runWithJunit(Path path,
                                      Runner runner,
                                      List<Failure> failures,
                                      List<Failure> failureDetails);  }