public <T> void reportStepFailureFor(Consequence<T> consequence, Throwable e) { ExecutedStepDescription consequenceDescription = ExecutedStepDescription.withTitle(consequence.toString()); StepEventBus.getEventBus().stepFailed(new StepFailure(consequenceDescription, e)); }
public void reportStepFailureFor(Performable todo, Throwable e) { ExecutedStepDescription taskDescription = ExecutedStepDescription.of(todo.getClass(),"attemptsTo"); StepEventBus.getEventBus().stepFailed(new StepFailure(taskDescription, e)); }
public void reportStepFailureFor(Performable todo, Throwable e) { ExecutedStepDescription taskDescription = ExecutedStepDescription.of(todo.getClass(),"attemptsTo"); StepEventBus.getEventBus().stepFailed(new StepFailure(taskDescription, e)); }
public <T> void reportStepFailureFor(Consequence<T> consequence, Throwable e) { ExecutedStepDescription consequenceDescription = ExecutedStepDescription.withTitle(consequence.toString()); StepEventBus.getEventBus().stepFailed(new StepFailure(consequenceDescription, e)); }
public void failed(String stepTitle, Throwable cause) { Throwable rootCause = cause.getCause() != null ? cause.getCause() : cause; StepEventBus.getEventBus().updateCurrentStepTitle(stepTitle); if (isAssumptionFailure(rootCause)) { StepEventBus.getEventBus().assumptionViolated(rootCause.getMessage()); } else { StepEventBus.getEventBus().stepFailed(new StepFailure(ExecutedStepDescription.withTitle(normalized(stepTitle)), rootCause)); } }
private void notifyOfStepFailure(final Method method, final Object[] args, final Throwable cause) throws Throwable { ExecutedStepDescription description = ExecutedStepDescription.of(testStepClass, getTestNameFrom(method, args)); StepFailure failure = new StepFailure(description, cause); StepEventBus.getEventBus().stepFailed(failure); if (shouldThrowExceptionImmediately()) { throw cause; } }
private void notifyOfStepFailure(final Method method, final Object[] args, final Throwable cause) throws Throwable { ExecutedStepDescription description = ExecutedStepDescription.of(testStepClass, getTestNameFrom(method, args)); StepFailure failure = new StepFailure(description, cause); StepEventBus.getEventBus().stepFailed(failure); if (shouldThrowExceptionImmediately()) { throw cause; } }
private void notifyOfStepFailure(final Object object, final Method method, final Object[] args, final Throwable cause) throws Throwable { ExecutedStepDescription description = ExecutedStepDescription.of(testStepClass, getTestNameFrom(method, args), args) .withDisplayedFields(fieldValuesIn(object)); StepFailure failure = new StepFailure(description, cause); StepEventBus.getEventBus().stepFailed(failure); if (shouldThrowExceptionImmediately()) { throw cause; } }
@Override public void failed(String stepTitle, Throwable cause) { if (!StepEventBus.getEventBus().testSuiteHasStarted()) { declareOutOfSuiteFailure(); } if (!errorOrFailureRecordedForStep(cause.getCause())) { StepEventBus.getEventBus().updateCurrentStepTitle(stepTitle); Throwable rootCause = new RootCauseAnalyzer(cause.getCause()).getRootCause().toException(); if (isAssumptionFailure(rootCause)) { StepEventBus.getEventBus().assumptionViolated(rootCause.getMessage()); } else { StepEventBus.getEventBus().stepFailed(new StepFailure(ExecutedStepDescription.withTitle(normalized(stepTitle)), rootCause)); } } }
private void failed(String stepTitle, Throwable cause) { if (!errorOrFailureRecordedForStep(stepTitle, cause)) { if (!isEmpty(stepTitle)) { getStepEventBus(currentFeaturePath()).updateCurrentStepTitle(stepTitle); } Throwable rootCause = new RootCauseAnalyzer(cause).getRootCause().toException(); if (isAssumptionFailure(rootCause)) { getStepEventBus(currentFeaturePath()).assumptionViolated(rootCause.getMessage()); } else { getStepEventBus(currentFeaturePath()).stepFailed(new StepFailure(ExecutedStepDescription.withTitle(normalized(currentStepTitle())), rootCause)); } } }
private void failed(String stepTitle, Throwable cause) { if (!errorOrFailureRecordedForStep(stepTitle, cause)) { if (!isEmpty(stepTitle)) { getStepEventBus(currentFeaturePath()).updateCurrentStepTitle(stepTitle); } Throwable rootCause = new RootCauseAnalyzer(cause).getRootCause().toException(); if (isAssumptionFailure(rootCause)) { getStepEventBus(currentFeaturePath()).assumptionViolated(rootCause.getMessage()); } else { getStepEventBus(currentFeaturePath()).stepFailed(new StepFailure(ExecutedStepDescription.withTitle(normalized(currentStepTitle())), rootCause)); } } }