本文整理匯總了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);
}