use of org.junit.runner.notification.RunNotifier in project component-runtime by Talend.
the class DelegatingRunnerTest method run.
@Test
void run() throws Throwable {
MyRunner.STEPS.clear();
new AllDefaultPossibilitiesBuilder(true).runnerForClass(TheTestModel.class).run(new RunNotifier());
assertEquals(asList("constructor>" + TheTestModel.class.getName(), "run"), MyRunner.STEPS);
}
use of org.junit.runner.notification.RunNotifier in project gerrit by GerritCodeReview.
the class ConfigSuiteTest method setUp.
@Before
public void setUp() {
notifier = new RunNotifier();
ConfigBasedTest.setConfigBasedTestListener(configBasedTestListener);
}
use of org.junit.runner.notification.RunNotifier in project ceylon-compiler by ceylon.
the class CeylonModuleRunner method makeModuleRunnerInNewJvm.
private void makeModuleRunnerInNewJvm(final ModuleSpecifier module) {
final Description description = Description.createTestDescription(getClass(), "Run " + module.module() + " in new JVM");
Runner runner = new Runner() {
@Override
public Description getDescription() {
return description;
}
@Override
public void run(RunNotifier notifier) {
notifier.fireTestStarted(description);
try {
String moduleName = module.module();
String version = Module.DEFAULT_MODULE_NAME.equals(moduleName) ? null : module.version();
String runClass = module.runClass();
if (runClass.isEmpty())
runClass = moduleName + ".run_";
runModuleInNewJvm(moduleName, version, runClass);
} catch (Exception x) {
x.printStackTrace();
notifier.fireTestFailure(new Failure(description, x));
}
notifier.fireTestFinished(description);
}
};
children.put(runner, description);
}
use of org.junit.runner.notification.RunNotifier in project ceylon-compiler by ceylon.
the class CeylonModuleRunner method createFailingTest.
void createFailingTest(List<Runner> moduleRunners, final String testName, final Exception ex) {
final Description description = Description.createTestDescription(getClass(), testName);
Runner runner = new Runner() {
@Override
public Description getDescription() {
return description;
}
@Override
public void run(RunNotifier notifier) {
notifier.fireTestStarted(description);
notifier.fireTestFailure(new Failure(description, ex));
notifier.fireTestFinished(description);
}
};
moduleRunners.add(runner);
}
use of org.junit.runner.notification.RunNotifier in project powermock by powermock.
the class PowerMockRunNotifierTest method verifyBackendRunNotifierIsProperlyNotified.
@Test
public void verifyBackendRunNotifierIsProperlyNotified() throws Exception {
Object[] testData = retrieveSuitableTestData();
RunNotifier backendRunNotifierMock = createMock(RunNotifier.class);
method.invoke(backendRunNotifierMock, testData);
replay(backendRunNotifierMock);
method.invoke(new PowerMockRunNotifier(backendRunNotifierMock, EasyMock.<PowerMockTestNotifier, PowerMockTestNotifier>createNiceMock(PowerMockTestNotifier.class), new Method[0]), testData);
verify(backendRunNotifierMock);
}
Aggregations