![JAR search and dependency download from the Maven repository](/logo.png)
org.junit.internal.runners.MethodRoadie Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of truffle-tck Show documentation
Show all versions of truffle-tck Show documentation
A collection of tests that can certify language implementation to be compliant
with most recent requirements of the Truffle infrastructure and tooling.
The newest version!
package org.junit.internal.runners;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import org.junit.internal.AssumptionViolatedException;
import org.junit.runner.Description;
import org.junit.runner.notification.Failure;
import org.junit.runner.notification.RunNotifier;
import org.junit.runners.BlockJUnit4ClassRunner;
/**
* @deprecated Included for backwards compatibility with JUnit 4.4. Will be
* removed in the next release. Please use
* {@link BlockJUnit4ClassRunner} in place of {@link JUnit4ClassRunner}.
*/
@Deprecated
public class MethodRoadie {
private final Object fTest;
private final RunNotifier fNotifier;
private final Description fDescription;
private TestMethod fTestMethod;
public MethodRoadie(Object test, TestMethod method, RunNotifier notifier, Description description) {
fTest = test;
fNotifier = notifier;
fDescription = description;
fTestMethod = method;
}
public void run() {
if (fTestMethod.isIgnored()) {
fNotifier.fireTestIgnored(fDescription);
return;
}
fNotifier.fireTestStarted(fDescription);
try {
long timeout = fTestMethod.getTimeout();
if (timeout > 0) {
runWithTimeout(timeout);
} else {
runTest();
}
} finally {
fNotifier.fireTestFinished(fDescription);
}
}
private void runWithTimeout(final long timeout) {
runBeforesThenTestThenAfters(new Runnable() {
public void run() {
ExecutorService service = Executors.newSingleThreadExecutor();
Callable
© 2015 - 2025 Weber Informatics LLC | Privacy Policy