Java Code Examples for org.junit.internal.runners.model.EachTestNotifier#fireTestFinished()

The following examples show how to use org.junit.internal.runners.model.EachTestNotifier#fireTestFinished() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SystemTestRunner.java    From pravega with Apache License 2.0 6 votes vote down vote up
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();
        }
    }
}
 
Example 2
Source File: GremlinProcessRunner.java    From tinkerpop with Apache License 2.0 6 votes vote down vote up
@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();
        }
    }
}
 
Example 3
Source File: StandaloneHiveRunner.java    From HiveRunner with Apache License 2.0 6 votes vote down vote up
@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();
        }
    }
}
 
Example 4
Source File: FlinkStandaloneHiveRunner.java    From flink with Apache License 2.0 5 votes vote down vote up
@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();
		}
	}
}
 
Example 5
Source File: FlinkStandaloneHiveRunner.java    From flink with Apache License 2.0 5 votes vote down vote up
@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();
		}
	}
}