本文整理汇总了Java中org.junit.internal.runners.model.EachTestNotifier.addFailedAssumption方法的典型用法代码示例。如果您正苦于以下问题:Java EachTestNotifier.addFailedAssumption方法的具体用法?Java EachTestNotifier.addFailedAssumption怎么用?Java EachTestNotifier.addFailedAssumption使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.junit.internal.runners.model.EachTestNotifier
的用法示例。
在下文中一共展示了EachTestNotifier.addFailedAssumption方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: runChild
import org.junit.internal.runners.model.EachTestNotifier; //导入方法依赖的package包/类
@Override
public void runChild(final FrameworkMethod method, final RunNotifier notifier) {
final Description description = describeChild(method);
if (this.isIgnored(method)) {
notifier.fireTestIgnored(description);
} else {
EachTestNotifier eachNotifier = new EachTestNotifier(notifier, description);
eachNotifier.fireTestStarted();
boolean ignored = false;
try {
this.methodBlock(method).evaluate();
} catch (AssumptionViolatedException ave) {
eachNotifier.addFailedAssumption(ave);
} catch (Throwable e) {
if (validateForGraphComputer(e)) {
eachNotifier.fireTestIgnored();
logger.info(e.getMessage());
ignored = true;
} else
eachNotifier.addFailure(e);
} finally {
if (!ignored)
eachNotifier.fireTestFinished();
}
}
}
示例2: whenAssumptionViolatedExceptionIsRaised
import org.junit.internal.runners.model.EachTestNotifier; //导入方法依赖的package包/类
/**
* Clients may override this method to add additional behavior when a {@link AssumptionViolatedException} is raised.
* The call of this method is guaranteed.
*
* @param notifier the notifier
* @param e the error
*/
protected void whenAssumptionViolatedExceptionIsRaised(final EachTestNotifier notifier, final AssumptionViolatedException e) {
notifier.addFailedAssumption(e);
}