RobolectricTestRunner
public class SandboxTestRunner
extends org.junit.runners.BlockJUnit4ClassRunner
Modifier and Type | Class | Description |
---|---|---|
protected static class |
SandboxTestRunner.HelperTestRunner |
Modifier and Type | Field | Description |
---|---|---|
protected ClassHandlerBuilder |
classHandlerBuilder |
Constructor | Description |
---|---|
SandboxTestRunner(Class<?> klass) |
|
SandboxTestRunner(Class<?> klass,
Injector injector) |
Modifier and Type | Method | Description |
---|---|---|
protected void |
afterClass() |
|
protected void |
afterTest(org.junit.runners.model.FrameworkMethod method,
Method bootstrappedMethod) |
|
protected void |
beforeTest(Sandbox sandbox,
org.junit.runners.model.FrameworkMethod method,
Method bootstrappedMethod) |
|
protected org.junit.runners.model.Statement |
classBlock(org.junit.runner.notification.RunNotifier notifier) |
|
protected void |
configureSandbox(Sandbox sandbox,
org.junit.runners.model.FrameworkMethod method) |
|
protected ClassHandler |
createClassHandler(ShadowMap shadowMap,
Sandbox sandbox) |
|
protected InstrumentationConfiguration |
createClassLoaderConfig(org.junit.runners.model.FrameworkMethod method) |
Create an
InstrumentationConfiguration suitable for the provided FrameworkMethod . |
protected static Injector.Builder |
defaultInjector() |
|
protected void |
finallyAfterTest(org.junit.runners.model.FrameworkMethod method) |
|
protected Collection<Interceptor> |
findInterceptors() |
|
protected Class<?>[] |
getExtraShadows(org.junit.runners.model.FrameworkMethod method) |
|
protected SandboxTestRunner.HelperTestRunner |
getHelperTestRunner(Class bootstrappedTestClass) |
|
protected Interceptors |
getInterceptors() |
|
protected Sandbox |
getSandbox(org.junit.runners.model.FrameworkMethod method) |
|
protected org.junit.runners.model.Statement |
methodBlock(org.junit.runners.model.FrameworkMethod method) |
|
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, methodInvoker, 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, classRules, createTestClass, filter, getDescription, getName, getRunnerAnnotations, getTestClass, order, run, runLeaf, setScheduler, sort, validatePublicVoidNoArgMethods, withAfterClasses, withBeforeClasses, withInterruptIsolation
protected final ClassHandlerBuilder classHandlerBuilder
public SandboxTestRunner(Class<?> klass) throws org.junit.runners.model.InitializationError
org.junit.runners.model.InitializationError
protected static Injector.Builder defaultInjector()
@Nonnull protected Collection<Interceptor> findInterceptors()
@Nonnull protected Interceptors getInterceptors()
protected org.junit.runners.model.Statement classBlock(org.junit.runner.notification.RunNotifier notifier)
classBlock
in class org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>
protected void afterClass()
@Nonnull protected Sandbox getSandbox(org.junit.runners.model.FrameworkMethod method)
@Nonnull protected InstrumentationConfiguration createClassLoaderConfig(org.junit.runners.model.FrameworkMethod method)
InstrumentationConfiguration
suitable for the provided FrameworkMethod
.
Custom TestRunner subclasses may wish to override this method to provide alternate configuration.method
- the test method that's about to runInstrumentationConfiguration
protected void configureSandbox(Sandbox sandbox, org.junit.runners.model.FrameworkMethod method)
protected org.junit.runners.model.Statement methodBlock(org.junit.runners.model.FrameworkMethod method)
methodBlock
in class org.junit.runners.BlockJUnit4ClassRunner
protected void beforeTest(Sandbox sandbox, org.junit.runners.model.FrameworkMethod method, Method bootstrappedMethod) throws Throwable
Throwable
protected void afterTest(org.junit.runners.model.FrameworkMethod method, Method bootstrappedMethod)
protected void finallyAfterTest(org.junit.runners.model.FrameworkMethod method)
protected SandboxTestRunner.HelperTestRunner getHelperTestRunner(Class bootstrappedTestClass)
@Nonnull protected Class<?>[] getExtraShadows(org.junit.runners.model.FrameworkMethod method)
@Nonnull protected ClassHandler createClassHandler(ShadowMap shadowMap, Sandbox sandbox)
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
BlockJUnit4ClassRunner.methodInvoker(FrameworkMethod, Object)
,
TimeLimitedStatement