RobolectricTestRunner.HelperTestRunner
protected static class SandboxTestRunner.HelperTestRunner
extends org.junit.runners.BlockJUnit4ClassRunner
Modifier and Type | Field | Description |
---|---|---|
org.junit.runners.model.FrameworkMethod |
frameworkMethod |
Constructor | Description |
---|---|
HelperTestRunner(Class<?> klass) |
Modifier and Type | Method | Description |
---|---|---|
protected org.junit.runners.model.Statement |
methodBlock(org.junit.runners.model.FrameworkMethod method) |
|
protected org.junit.runners.model.Statement |
methodInvoker(org.junit.runners.model.FrameworkMethod method,
Object test) |
For tests with a timeout, we need to wrap the test method execution (but not
@Before s
or @After s in a TimeLimitedStatement . |
protected org.junit.runners.model.Statement |
withPotentialTimeout(org.junit.runners.model.FrameworkMethod method,
Object test,
org.junit.runners.model.Statement next) |
Disables JUnit's normal timeout mode strategy.
|
collectInitializationErrors, computeTestMethods, createTest, createTest, describeChild, getChildren, getTestRules, isIgnored, possiblyExpectingExceptions, rules, runChild, testName, validateConstructor, validateFields, validateInstanceMethods, validateNoNonStaticInnerClass, validateOnlyOneConstructor, validateTestMethods, validateZeroArgConstructor, withAfters, withBefores
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
childrenInvoker, classBlock, classRules, createTestClass, filter, getDescription, getName, getRunnerAnnotations, getTestClass, order, run, runLeaf, setScheduler, sort, validatePublicVoidNoArgMethods, withAfterClasses, withBeforeClasses, withInterruptIsolation
public HelperTestRunner(Class<?> klass) throws org.junit.runners.model.InitializationError
org.junit.runners.model.InitializationError
protected org.junit.runners.model.Statement methodBlock(org.junit.runners.model.FrameworkMethod method)
methodBlock
in class org.junit.runners.BlockJUnit4ClassRunner
protected org.junit.runners.model.Statement methodInvoker(org.junit.runners.model.FrameworkMethod method, Object test)
@Before
s
or @After
s in a TimeLimitedStatement
. JUnit's built-in FailOnTimeout
statement causes the test method (but not @Before
s or @After
s) to be run on a
short-lived thread. This is inadequate for our purposes; we want to guarantee that every
entry point to test code is run from the same thread.methodInvoker
in class org.junit.runners.BlockJUnit4ClassRunner
protected org.junit.runners.model.Statement withPotentialTimeout(org.junit.runners.model.FrameworkMethod method, Object test, org.junit.runners.model.Statement next)
withPotentialTimeout
in class org.junit.runners.BlockJUnit4ClassRunner
methodInvoker(FrameworkMethod, Object)
,
TimeLimitedStatement