org.junit.internal.runners.model.EachTestNotifier#fireTestFinished ( )源码实例Demo

下面列出了org.junit.internal.runners.model.EachTestNotifier#fireTestFinished ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: pravega   文件: SystemTestRunner.java
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) {
            log.error("Test " + method + " failed with exception ", e);
            eachNotifier.addFailure(unwrap(e));
        } finally {
            eachNotifier.fireTestFinished();
        }
    }
}
 
源代码2 项目: tinkerpop   文件: 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 {
        final 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();
        }
    }
}
 
源代码3 项目: HiveRunner   文件: StandaloneHiveRunner.java
@Override
protected void runChild(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 项目: flink   文件: FlinkStandaloneHiveRunner.java
@Override
protected void runChild(final FrameworkMethod method, RunNotifier notifier) {
	Description description = describeChild(method);
	if (method.getAnnotation(Ignore.class) != null) {
		notifier.fireTestIgnored(description);
	} else {
		EachTestNotifier eachNotifier = new EachTestNotifier(notifier, description);
		eachNotifier.fireTestStarted();
		try {
			runTestMethod(method, eachNotifier);
		} finally {
			eachNotifier.fireTestFinished();
		}
	}
}
 
源代码5 项目: flink   文件: FlinkStandaloneHiveRunner.java
@Override
protected void runChild(final FrameworkMethod method, RunNotifier notifier) {
	Description description = describeChild(method);
	if (method.getAnnotation(Ignore.class) != null) {
		notifier.fireTestIgnored(description);
	} else {
		EachTestNotifier eachNotifier = new EachTestNotifier(notifier, description);
		eachNotifier.fireTestStarted();
		try {
			runTestMethod(method, eachNotifier);
		} finally {
			eachNotifier.fireTestFinished();
		}
	}
}