org.junit.internal.runners.model.EachTestNotifier Java Examples
The following examples show how to use
org.junit.internal.runners.model.EachTestNotifier.
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 |
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 |
@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: PinpointJUnit4ClassRunner.java From pinpoint with Apache License 2.0 | 6 votes |
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, 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 { trace.close(); } } finally { traceContext.removeTraceObject(); } } }
Example #4
Source File: StandaloneHiveRunner.java From HiveRunner with Apache License 2.0 | 6 votes |
@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 #5
Source File: FlinkStandaloneHiveRunner.java From flink with Apache License 2.0 | 5 votes |
@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 #6
Source File: RetryRunner.java From java-sdk with Apache License 2.0 | 5 votes |
@Override public void run(final RunNotifier notifier) { EachTestNotifier testNotifier = new EachTestNotifier(notifier, getDescription()); Statement statement = classBlock(notifier); try { statement.evaluate(); } catch (AssumptionViolatedException ave) { testNotifier.fireTestIgnored(); } catch (StoppedByUserException sbue) { throw sbue; } catch (Throwable t) { LOG.warning("Retry class: " + getDescription().getDisplayName()); retry(testNotifier, statement, t, getDescription()); } }
Example #7
Source File: FlinkStandaloneHiveRunner.java From flink with Apache License 2.0 | 5 votes |
@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 #8
Source File: ParameterizedMultiRunner.java From cougar with Apache License 2.0 | 4 votes |
protected EachTestNotifier makeNotifier(FrameworkMethod method, RunNotifier notifier) { Description description= describeChild(method); return new EachTestNotifier(notifier, description); }
Example #9
Source File: MultiRunner.java From cougar with Apache License 2.0 | 4 votes |
protected EachTestNotifier makeNotifier(FrameworkMethod method, RunNotifier notifier) { Description description= describeChild(method); return new EachTestNotifier(notifier, description); }
Example #10
Source File: SpringJUnit4ParameterizedClassRunner.java From tds with BSD 3-Clause "New" or "Revised" License | 2 votes |
/** * <code>springMakeNotifier()</code> is an exact copy of * {@link BlockJUnit4ClassRunner BlockJUnit4ClassRunner's} * <code>makeNotifier()</code> method, but we have decided to prefix it with * "spring" and keep it <code>private</code> 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, RunNotifier notifier) { Description description = describeChild(method); return new EachTestNotifier(notifier, description); }
Example #11
Source File: ClassRunner.java From dsl-devkit with Eclipse Public License 1.0 | 2 votes |
/** * 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)); }