use of org.junit.runner.notification.RunNotifier in project cucumber-jvm by cucumber.
the class FeatureRunnerTest method should_not_issue_notification_for_steps_by_default_two_scenarios_with_background.
@Test
void should_not_issue_notification_for_steps_by_default_two_scenarios_with_background() {
Feature feature = TestPickleBuilder.parseFeature("path/test.feature", "" + "Feature: feature name\n" + " Background: background\n" + " Given step #1\n" + " Scenario: scenario_1 name\n" + " When step #2\n" + " Then step #3\n" + " Scenario: scenario_2 name\n" + " Then step #2\n");
RunNotifier notifier = runFeatureWithNotifier(feature, new JUnitOptions());
InOrder order = inOrder(notifier);
order.verify(notifier).fireTestStarted(argThat(new DescriptionMatcher("scenario_1 name(feature name)")));
order.verify(notifier, times(1)).fireTestFailure(argThat(new FailureMatcher("scenario_1 name(feature name)")));
order.verify(notifier).fireTestFinished(argThat(new DescriptionMatcher("scenario_1 name(feature name)")));
order.verify(notifier).fireTestStarted(argThat(new DescriptionMatcher("scenario_2 name(feature name)")));
order.verify(notifier, times(1)).fireTestFailure(argThat(new FailureMatcher("scenario_2 name(feature name)")));
order.verify(notifier).fireTestFinished(argThat(new DescriptionMatcher("scenario_2 name(feature name)")));
}
use of org.junit.runner.notification.RunNotifier in project component-runtime by Talend.
the class MultiEnvironmentsRunnerTest method run.
@org.junit.jupiter.api.Test
void run() throws Throwable {
STEPS.clear();
new AllDefaultPossibilitiesBuilder(true).runnerForClass(TheTestModel.class).run(new RunNotifier());
assertEquals(asList("start>E1", "test1", "test2", "stop>E1", "start>E2", "test1", "test2", "stop>E2"), STEPS);
}
use of org.junit.runner.notification.RunNotifier in project junit4 by junit-team.
the class ParentRunnerTest method runTestWithParentRunner.
private CountingRunListener runTestWithParentRunner(Class<?> testClass) throws InitializationError {
CountingRunListener listener = new CountingRunListener();
RunNotifier runNotifier = new RunNotifier();
runNotifier.addListener(listener);
ParentRunner<?> runner = new BlockJUnit4ClassRunner(testClass);
runner.run(runNotifier);
return listener;
}
use of org.junit.runner.notification.RunNotifier in project junit4 by junit-team.
the class OldTestClassAdaptingListenerTest method addFailureDelegatesToNotifier.
@Test
public void addFailureDelegatesToNotifier() {
Result result = new Result();
RunListener listener = result.createListener();
RunNotifier notifier = new RunNotifier();
notifier.addFirstListener(listener);
TestCase testCase = new TestCase() {
};
TestListener adaptingListener = new JUnit38ClassRunner(testCase).createAdaptingListener(notifier);
adaptingListener.addFailure(testCase, new AssertionFailedError());
assertEquals(1, result.getFailureCount());
}
use of org.junit.runner.notification.RunNotifier in project junit4 by junit-team.
the class UserStopTest method createNotifier.
@Before
public void createNotifier() {
fNotifier = new RunNotifier();
fNotifier.pleaseStop();
}
Aggregations