本文整理汇总了Java中org.junit.internal.runners.model.EachTestNotifier.fireTestStarted方法的典型用法代码示例。如果您正苦于以下问题:Java EachTestNotifier.fireTestStarted方法的具体用法?Java EachTestNotifier.fireTestStarted怎么用?Java EachTestNotifier.fireTestStarted使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.junit.internal.runners.model.EachTestNotifier
的用法示例。
在下文中一共展示了EachTestNotifier.fireTestStarted方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: runChild
import org.junit.internal.runners.model.EachTestNotifier; //导入方法依赖的package包/类
@Override
protected void runChild(FrameworkMethod method, RunNotifier notifier) {
EachTestNotifier eachNotifier = makeNotifier( method, notifier );
FuzzUnitTestMethod tTestMethod = (FuzzUnitTestMethod) method;
eachNotifier.fireTestStarted();
if( method.getAnnotation( Ignore.class ) != null ) {
eachNotifier.fireTestIgnored();
return;
}
try {
methodBlock( tTestMethod ).evaluate();
} catch (Throwable e) {
eachNotifier.addFailure( e );
} finally {
eachNotifier.fireTestFinished();
}
}
示例3: runChild
import org.junit.internal.runners.model.EachTestNotifier; //导入方法依赖的package包/类
@Override
protected void runChild(final FrameworkMethod method, RunNotifier notifier) {
Description description = describeChild(method);
if (method.getAnnotation(Ignore.class) != null) {
notifier.fireTestIgnored(description);
} else {
setLogContext(method);
EachTestNotifier eachNotifier = new EachTestNotifier(notifier, description);
eachNotifier.fireTestStarted();
try {
runTestMethod(method, eachNotifier, config.getTimeoutRetries());
} finally {
eachNotifier.fireTestFinished();
clearLogContext();
}
}
}
示例4: invokeTest
import org.junit.internal.runners.model.EachTestNotifier; //导入方法依赖的package包/类
private void invokeTest(RunNotifier notifier, TestExecutorType type, FrameworkMethod method) {
if ((type == null) || TestExecutorType.LOCAL.equals(type)) {
runLeaf(methodBlock(method), describeChild(method), notifier);
} else {
EachTestNotifier eachNotifier = new EachTestNotifier(notifier, describeChild(method));
try {
eachNotifier.fireTestStarted();
execute(type, method.getMethod()).get();
} catch (Throwable e) {
eachNotifier.addFailure(e);
} finally {
eachNotifier.fireTestFinished();
}
}
}
示例5: runLeafAndIgnoreErrors
import org.junit.internal.runners.model.EachTestNotifier; //导入方法依赖的package包/类
private void runLeafAndIgnoreErrors(Statement statement, Description description, RunNotifier notifier) {
EachTestNotifier eachNotifier = new EachTestNotifier(notifier, description);
eachNotifier.fireTestStarted();
try {
statement.evaluate();
} catch (Throwable e) {
// An error ? Surely you must be joking
} finally {
eachNotifier.fireTestFinished();
}
}
示例6: runChild
import org.junit.internal.runners.model.EachTestNotifier; //导入方法依赖的package包/类
@Override
protected void runChild(Test child, RunNotifier notifier) {
Description description = describeChild(child);
EachTestNotifier eachTestNotifier = new EachTestNotifier(
notifier, description);
eachTestNotifier.fireTestStarted();
try {
child.statement.evaluate();
} catch (Throwable t) {
eachTestNotifier.addFailure(t);
} finally {
eachTestNotifier.fireTestFinished();
}
}
示例7: beforeExecution
import org.junit.internal.runners.model.EachTestNotifier; //导入方法依赖的package包/类
@Override
protected void beforeExecution(final EachTestNotifier notifier) {
notifier.fireTestStarted();
}