@Override protected void verify() throws Throwable { MultipleFailureException.assertEmpty(errors); }
@Override protected void verify() throws Throwable { MultipleFailureException.assertEmpty(errors); }
@Override public void evaluate() throws Throwable { List<Throwable> errors = new ArrayList<Throwable>(); startingQuietly(description, errors); try { base.evaluate(); succeededQuietly(description, errors); } catch (org.junit.internal.AssumptionViolatedException e) { errors.add(e); skippedQuietly(e, description, errors); } catch (Throwable e) { errors.add(e); failedQuietly(e, description, errors); } finally { finishedQuietly(description, errors); } MultipleFailureException.assertEmpty(errors); } };
/** * Evaluate the next {@link Statement} in the execution chain (typically an instance of * {@link org.junit.internal.runners.statements.RunAfters RunAfters}), catching any * exceptions thrown, and then invoke {@link TestContextManager#afterTestClass()}. * <p>If the invocation of {@code afterTestClass()} throws an exception, it will also * be tracked. Multiple exceptions will be combined into a {@link MultipleFailureException}. */ @Override public void evaluate() throws Throwable { List<Throwable> errors = new ArrayList<>(); try { this.next.evaluate(); } catch (Throwable ex) { errors.add(ex); } try { this.testContextManager.afterTestClass(); } catch (Throwable ex) { errors.add(ex); } MultipleFailureException.assertEmpty(errors); }
/** * Evaluate the next {@link Statement} in the execution chain (typically an * instance of {@link RunBeforeTestExecutionCallbacks}), catching any exceptions * thrown, and then invoke {@link TestContextManager#afterTestExecution} supplying * the first caught exception (if any). * <p>If the invocation of {@code afterTestExecution()} throws an exception, that * exception will also be tracked. Multiple exceptions will be combined into a * {@link MultipleFailureException}. */ @Override public void evaluate() throws Throwable { Throwable testException = null; List<Throwable> errors = new ArrayList<>(); try { this.next.evaluate(); } catch (Throwable ex) { testException = ex; errors.add(ex); } try { this.testContextManager.afterTestExecution(this.testInstance, this.testMethod, testException); } catch (Throwable ex) { errors.add(ex); } MultipleFailureException.assertEmpty(errors); }
@Override public void evaluate() throws Throwable { List<Throwable> errors = new ArrayList<Throwable>(); startingQuietly(description, errors); try { base.evaluate(); succeededQuietly(description, errors); } catch (AssumptionViolatedException e) { errors.add(e); skippedQuietly(e, description, errors); } catch (Throwable t) { errors.add(t); failedQuietly(t, description, errors); } finally { finishedQuietly(description, errors); } MultipleFailureException.assertEmpty(errors); } };
/** * Evaluate the next {@link Statement} in the execution chain (typically an instance of * {@link org.junit.internal.runners.statements.RunAfters RunAfters}), catching any * exceptions thrown, and then invoke * {@link TestContextManager#afterTestMethod(Object, Method, Throwable)} supplying the * first caught exception (if any). * <p>If the invocation of {@code afterTestMethod()} throws an exception, that * exception will also be tracked. Multiple exceptions will be combined into a * {@link MultipleFailureException}. */ @Override public void evaluate() throws Throwable { Throwable testException = null; List<Throwable> errors = new ArrayList<>(); try { this.next.evaluate(); } catch (Throwable ex) { testException = ex; errors.add(ex); } try { this.testContextManager.afterTestMethod(this.testInstance, this.testMethod, testException); } catch (Throwable ex) { errors.add(ex); } MultipleFailureException.assertEmpty(errors); }
@Override public void evaluate() throws Throwable { List<Throwable> errors = new ArrayList<Throwable>(); try { next.evaluate(); } catch (Throwable e) { errors.add(e); } finally { for (FrameworkMethod each : afters) { try { invokeMethod(each); } catch (Throwable e) { errors.add(e); } } } MultipleFailureException.assertEmpty(errors); }
@Override public void evaluate() throws Throwable { List<Throwable> errors = new ArrayList<Throwable>(); try { fNext.evaluate(); } catch (Throwable e) { errors.add(e); } finally { for (FrameworkMethod each : fAfters) { try { each.invokeExplosively(fTarget); } catch (Throwable e) { errors.add(e); } } } MultipleFailureException.assertEmpty(errors); } }
@Override public void evaluate() throws Throwable { before(); List<Throwable> errors = new ArrayList<Throwable>(); try { base.evaluate(); } catch (Throwable t) { errors.add(t); } finally { try { after(); } catch (Throwable t) { errors.add(t); } } MultipleFailureException.assertEmpty(errors); } };
@Override public void evaluate() throws Throwable { baseStatement.evaluate(); List<Throwable> errors = soft.errorsCollected(); if (errors.isEmpty()) return; // tests assertions raised some errors tryThrowingMultipleFailuresError(errors); // failed to throw MultipleFailuresError -> throw MultipleFailureException instead MultipleFailureException.assertEmpty(errors); } };
private void completeThreads() throws Throwable { List<Throwable> failures = new ArrayList<>(); completeThreads( failures ); MultipleFailureException.assertEmpty( failures ); }
@Override public void evaluate() throws Throwable { baseStatement.evaluate(); List<Throwable> errors = soft.errorsCollected(); if (errors.isEmpty()) return; // tests assertions raised some errors assertionErrorCreator.tryThrowingMultipleFailuresError(errors); // failed to throw MultipleFailuresError -> throw MultipleFailureException instead MultipleFailureException.assertEmpty(errors); } };
@Override public void evaluate() throws Throwable { List<Throwable> errors = new ArrayList<Throwable>(); startingQuietly(description, errors); try { base.evaluate(); succeededQuietly(description, errors); } catch (AssumptionViolatedException e) { errors.add(e); skippedQuietly(e, description, errors); } catch (Throwable t) { errors.add(t); failedQuietly(t, description, errors); } finally { finishedQuietly(description, errors); } MultipleFailureException.assertEmpty(errors); } };
@Override public void evaluate() throws Throwable { List<Throwable> errors = new ArrayList<Throwable>(); try { starting(description); base.evaluate(); succeeded(description); } catch (Throwable e) { errors.add(e); failed(e, description); } finally { finished(description); } MultipleFailureException.assertEmpty(errors); } };
@Override public void evaluate() throws Throwable { repository = new Repository( description ); List<Throwable> failures = new ArrayList<>(); try { base.evaluate(); } catch ( Throwable failure ) { failures.add( failure ); } finally { completeThreads( failures ); } MultipleFailureException.assertEmpty( failures ); } };
@Override protected void verify() throws Throwable { MultipleFailureException.assertEmpty(errors); }
@Override public void evaluate() throws Throwable { List<Throwable> errors = new ArrayList<Throwable>(); startingQuietly(description, errors); try { base.evaluate(); succeededQuietly(description, errors); } catch (AssumptionViolatedException e) { errors.add(e); skippedQuietly(e, description, errors); } catch (Throwable t) { errors.add(t); failedQuietly(t, description, errors); } finally { finishedQuietly(description, errors); } MultipleFailureException.assertEmpty(errors); } };
@Override public void evaluate() throws Throwable { List<Throwable> errors = new ArrayList<Throwable>(); try { fNext.evaluate(); } catch (Throwable e) { errors.add(e); } finally { for (FrameworkMethod each : fAfters) { try { each.invokeExplosively(fTarget); } catch (Throwable e) { errors.add(e); } } } MultipleFailureException.assertEmpty(errors); } }
@Override public void evaluate() throws Throwable { List<Throwable> errors = new ArrayList<>(); try { starting(description); base.evaluate(); succeeded(description); } catch (Throwable e) { errors.add(e); try { failed(e, description); } catch (Throwable failedException) { errors.add(failedException); } triggerCustomAfters(errors); } finally { try { if (!customAftersTriggered) { triggerCustomAfters(errors); } finished(description); } catch (Throwable failedException) { errors.add(failedException); } } MultipleFailureException.assertEmpty(errors); } };