项目:OHMS
文件:RetryRunner.java
public void retry( EachTestNotifier notifier,Statement statement,Throwable currentThrowable )
{
Throwable caughtThrowable = currentThrowable;
while ( retryCount > FailedAttempts )
{
try
{
timeout( FailedAttempts + 1 );
statement.evaluate();
return;
}
catch ( Throwable t )
{
FailedAttempts++;
caughtThrowable = t;
}
}
notifier.addFailure( caughtThrowable );
}
项目:LiteGraph
文件:GremlinProcessRunner.java
@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();
}
}
}
项目:FuzzUnit
文件:FuzzUnitTestRunner.java
@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();
}
}
项目:apm-agent
文件:PinpointJUnit4ClassRunner.java
private void endTracing(FrameworkMethod method,RunNotifier notifier) {
if (shouldCreateNewTraceObject(method)) {
TraceContext traceContext = this.testAgent.getTraceContext();
try {
Trace trace = traceContext.currentRawTraceObject();
if (trace == null) {
// Trace is already detached from the ThreadLocal storage.
// Happens when root trace method is tested without @IsRootSpan.
EachTestNotifier testMethodNotifier = new EachTestNotifier(notifier,super.describeChild(method));
String traceObjectAlreadyDetachedMessage = "Trace object already detached. If you're testing a trace root,please add @IsRootSpan to the test method";
testMethodNotifier.addFailure(new IllegalStateException(traceObjectAlreadyDetachedMessage));
} else {
try {
trace.markAfterTime();
} finally {
trace.traceRootBlockEnd();
}
}
} finally {
traceContext.detachTraceObject();
}
}
}
项目:tinkerpop
文件:GremlinProcessRunner.java
@Override
public void runchild(final FrameworkMethod method,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();
}
}
}
项目:pinpoint
文件:PinpointJUnit4ClassRunner.java
private void endTracing(FrameworkMethod method,RunNotifier notifier) {
if (shouldCreateNewTraceObject(method)) {
TraceContext traceContext = getTraceContext();
try {
Trace trace = traceContext.currentRawTraceObject();
if (trace == null) {
// Trace is already detached from the ThreadLocal storage.
// Happens when root trace method is tested without @IsRootSpan.
EachTestNotifier testMethodNotifier = new EachTestNotifier(notifier,please add @IsRootSpan to the test method";
testMethodNotifier.addFailure(new IllegalStateException(traceObjectAlreadyDetachedMessage));
} else {
trace.close();
}
} finally {
traceContext.removeTraceObject();
}
}
}
项目:HiveRunner
文件:StandaloneHiveRunner.java
@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();
}
}
}
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();
}
}
}
项目:junit-volkswagen
文件:VolkswagenTestRunner.java
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();
}
}
项目:jsimpleshell-rc
文件:UnstableTestRunner.java
public void retry(EachTestNotifier notifier,Throwable currentThrowable) {
Throwable caughtThrowable = currentThrowable;
while (RETRY_COUNT > FailedAttempts) {
try {
statement.evaluate();
return;
} catch (Throwable t) {
FailedAttempts++;
caughtThrowable = t;
}
}
notifier.addFailure(caughtThrowable);
}
项目:junit-playground
文件:Java8Runner.java
@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();
}
}
项目:KoPeMe
文件:PerformanceTestRunnerJUnit.java
/**
* Sets that tests are Failed.
*
* @param notifier
* Notifier that should be notified
*/
protected void setTestsToFail(final RunNotifier notifier) {
final Description description = getDescription();
final ArrayList<Description> toBeFailed = new ArrayList<>(description.getChildren()); // all testmethods will be covered and set to Failed here
toBeFailed.add(description); // the whole test class Failed
for (final Description d : toBeFailed) {
final EachTestNotifier testNotifier = new EachTestNotifier(notifier,d);
testNotifier.addFailure(new TimeoutException("Test timed out because of class timeout"));
}
}
项目:bobcat
文件:TestRunner.java
private EachTestNotifier makeNotifier(FrameworkMethod method,RunNotifier notifier) {
Description description = describeChild(method);
return new EachTestNotifier(notifier,description);
}
项目:guice-behave
文件:TestRunner.java
private EachTestNotifier makeNotifier(FrameworkMethod method,RunNotifier notifier) {
Description description = describeChild(method);
return new EachTestNotifier(notifier,description);
}
protected EachTestNotifier makeNotifier(FrameworkMethod method,RunNotifier notifier) {
Description description= describeChild(method);
return new EachTestNotifier(notifier,description);
}
项目:cougar
文件:MultiRunner.java
protected EachTestNotifier makeNotifier(FrameworkMethod method,description);
}
项目:junit-hierarchicalcontextrunner
文件:MethodStatementExecutor.java
@Override
protected void beforeExecution(final EachTestNotifier notifier) {
notifier.fireTestStarted();
}
项目:junit-hierarchicalcontextrunner
文件:MethodStatementExecutor.java
@Override
protected void afterExecution(final EachTestNotifier notifier) {
notifier.fireTestFinished();
}
项目:dsl-devkit
文件:ClassRunner.java
/**
* Creates a notifier for each test.
*
* @param method
* the {@link FrameworkMethod},must not be {@code null}
* @param notifier
* the {@link RunNotifier},must not be {@code null}
* @return an instance of {@link EachTestNotifier},never {@code null}
*/
private EachTestNotifier createNotifier(final FrameworkMethod method,final RunNotifier notifier) {
return new EachTestNotifier(notifier,describeChild(method));
}
项目:FuzzUnit
文件:FuzzUnitTestRunner.java
项目:class-guard
文件:SpringJUnit4ClassRunner.java
/**
* {@code springMakeNotifier()} is an exact copy of
* {@link BlockJUnit4ClassRunner BlockJUnit4ClassRunner's}
* {@code makeNotifier()} method,but we have decided to prefix it with
* "spring" and keep it {@code private} in order to avoid the
* compatibility clashes that were introduced in JUnit between versions 4.5,* 4.6,and 4.7.
*/
private EachTestNotifier springMakeNotifier(FrameworkMethod method,description);
}
项目:junit-hierarchicalcontextrunner
文件:StatementExecutor.java
项目:junit-hierarchicalcontextrunner
文件:StatementExecutor.java
/**
* Clients may override this method to add additional behavior when a {@link InitializationError} is raised.
* The call of this method is guaranteed.
*
* @param notifier the notifier
* @param e the error
*/
protected void whenInitializationErrorIsRaised(final EachTestNotifier notifier,final InitializationError e) {
notifier.addFailure(new MultipleFailureException(e.getCauses()));
}
项目:junit-hierarchicalcontextrunner
文件:StatementExecutor.java
/**
* 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);
}
项目:junit-hierarchicalcontextrunner
文件:StatementExecutor.java
项目:junit-hierarchicalcontextrunner
文件:StatementExecutor.java
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。