use of org.junit.internal.runners.model.EachTestNotifier in project cucumber-jvm by cucumber.
the class JUnitReporterTest method failed_step_and_after_with_pending_exception_non_strict.
@Test
public void failed_step_and_after_with_pending_exception_non_strict() {
createNonStrictReporter();
createDefaultRunNotifier();
Result stepResult = mock(Result.class);
Throwable exception = mock(Throwable.class);
when(stepResult.getError()).thenReturn(exception);
Result hookResult = mock(Result.class);
Match match = mock(Match.class);
when(hookResult.getStatus()).thenReturn("Pending");
when(hookResult.getError()).thenReturn(new PendingException());
EachTestNotifier executionUnitNotifier = mock(EachTestNotifier.class);
jUnitReporter.executionUnitNotifier = executionUnitNotifier;
jUnitReporter.result(stepResult);
jUnitReporter.after(match, hookResult);
jUnitReporter.finishExecutionUnit();
verify(executionUnitNotifier, times(0)).fireTestIgnored();
}
use of org.junit.internal.runners.model.EachTestNotifier in project cucumber-jvm by cucumber.
the class JUnitReporter method startExecutionUnit.
public void startExecutionUnit(ExecutionUnitRunner executionUnitRunner, RunNotifier runNotifier) {
this.executionUnitRunner = executionUnitRunner;
this.runNotifier = runNotifier;
this.stepNotifier = null;
this.failedStep = false;
this.ignoredStep = false;
executionUnitNotifier = new EachTestNotifier(runNotifier, executionUnitRunner.getDescription());
executionUnitNotifier.fireTestStarted();
}
use of org.junit.internal.runners.model.EachTestNotifier in project cucumber-jvm by cucumber.
the class JUnitReporter method match.
public void match(Match match) {
Step runnerStep = fetchAndCheckRunnerStep();
Description description = executionUnitRunner.describeChild(runnerStep);
stepNotifier = new EachTestNotifier(runNotifier, description);
reporter.match(match);
if (junitOptions.allowStartedIgnored()) {
stepNotifier.fireTestStarted();
}
}
use of org.junit.internal.runners.model.EachTestNotifier in project robolectric by robolectric.
the class SandboxTestRunner method runChild.
@Override
protected void runChild(FrameworkMethod method, RunNotifier notifier) {
Description description = describeChild(method);
EachTestNotifier eachNotifier = new EachTestNotifier(notifier, description);
if (shouldIgnore(method)) {
eachNotifier.fireTestIgnored();
} else {
eachNotifier.fireTestStarted();
try {
methodBlock(method).evaluate();
} catch (AssumptionViolatedException e) {
eachNotifier.addFailedAssumption(e);
} catch (Throwable e) {
eachNotifier.addFailure(e);
} finally {
eachNotifier.fireTestFinished();
}
}
}
use of org.junit.internal.runners.model.EachTestNotifier in project sling by apache.
the class SlingRemoteTestRunner method runChild.
@Override
protected void runChild(SlingRemoteTest t, RunNotifier notifier) {
try {
maybeExecuteTests();
} catch (Exception e) {
throw new Error(e);
}
EachTestNotifier eachNotifier = new EachTestNotifier(notifier, t.describe());
eachNotifier.fireTestStarted();
try {
log.debug("Running test {}", t.describe());
t.run();
} catch (AssumptionViolatedException e) {
eachNotifier.addFailedAssumption(e);
} catch (Throwable e) {
eachNotifier.addFailure(e);
} finally {
eachNotifier.fireTestFinished();
}
}
Aggregations