本文整理汇总了Java中org.junit.runners.ParentRunner.run方法的典型用法代码示例。如果您正苦于以下问题:Java ParentRunner.run方法的具体用法?Java ParentRunner.run怎么用?Java ParentRunner.run使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.junit.runners.ParentRunner
的用法示例。
在下文中一共展示了ParentRunner.run方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: useChildHarvester
import org.junit.runners.ParentRunner; //导入方法依赖的package包/类
@Test
public void useChildHarvester() throws InitializationError {
log = "";
ParentRunner<?> runner = new BlockJUnit4ClassRunner(FruitTest.class);
runner.setScheduler(new RunnerScheduler() {
public void schedule(Runnable childStatement) {
log += "before ";
childStatement.run();
log += "after ";
}
public void finished() {
log += "afterAll ";
}
});
runner.run(new RunNotifier());
assertEquals("before apple after before banana after afterAll ", log);
}
示例2: runTestWithParentRunner
import org.junit.runners.ParentRunner; //导入方法依赖的package包/类
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;
}
示例3: runChild
import org.junit.runners.ParentRunner; //导入方法依赖的package包/类
@Override
protected void runChild(ParentRunner<?> child, RunNotifier notifier) {
child.run(notifier);
}