Package org.robolectric.internal
Class SandboxTestRunner
- java.lang.Object
-
- org.junit.runner.Runner
-
- org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>
-
- org.junit.runners.BlockJUnit4ClassRunner
-
- org.robolectric.internal.SandboxTestRunner
-
- All Implemented Interfaces:
org.junit.runner.Describable
,org.junit.runner.manipulation.Filterable
,org.junit.runner.manipulation.Orderable
,org.junit.runner.manipulation.Sortable
- Direct Known Subclasses:
RobolectricTestRunner
public class SandboxTestRunner extends org.junit.runners.BlockJUnit4ClassRunner
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
SandboxTestRunner.HelperTestRunner
-
Field Summary
Fields Modifier and Type Field Description protected ClassHandlerBuilder
classHandlerBuilder
-
Constructor Summary
Constructors Constructor Description SandboxTestRunner(Class<?> klass)
SandboxTestRunner(Class<?> klass, Injector injector)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods 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 anInstrumentationConfiguration
suitable for the providedFrameworkMethod
.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.-
Methods inherited from class org.junit.runners.BlockJUnit4ClassRunner
collectInitializationErrors, computeTestMethods, createTest, createTest, describeChild, getChildren, getTestRules, isIgnored, methodInvoker, possiblyExpectingExceptions, rules, runChild, testName, validateConstructor, validateFields, validateInstanceMethods, validateNoNonStaticInnerClass, validateOnlyOneConstructor, validateTestMethods, validateZeroArgConstructor, withAfters, withBefores
-
Methods inherited from class org.junit.runners.ParentRunner
childrenInvoker, classRules, createTestClass, filter, getDescription, getName, getRunnerAnnotations, getTestClass, order, run, runLeaf, setScheduler, sort, validatePublicVoidNoArgMethods, withAfterClasses, withBeforeClasses, withInterruptIsolation
-
-
-
-
Field Detail
-
classHandlerBuilder
protected final ClassHandlerBuilder classHandlerBuilder
-
-
Constructor Detail
-
SandboxTestRunner
public SandboxTestRunner(Class<?> klass) throws org.junit.runners.model.InitializationError
- Throws:
org.junit.runners.model.InitializationError
-
-
Method Detail
-
defaultInjector
protected static Injector.Builder defaultInjector()
-
findInterceptors
@Nonnull protected Collection<Interceptor> findInterceptors()
-
getInterceptors
@Nonnull protected Interceptors getInterceptors()
-
classBlock
protected org.junit.runners.model.Statement classBlock(org.junit.runner.notification.RunNotifier notifier)
- Overrides:
classBlock
in classorg.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>
-
afterClass
protected void afterClass()
-
createClassLoaderConfig
@Nonnull protected InstrumentationConfiguration createClassLoaderConfig(org.junit.runners.model.FrameworkMethod method)
Create anInstrumentationConfiguration
suitable for the providedFrameworkMethod
.Custom TestRunner subclasses may wish to override this method to provide alternate configuration.
- Parameters:
method
- the test method that's about to run- Returns:
- an
InstrumentationConfiguration
-
configureSandbox
protected void configureSandbox(Sandbox sandbox, org.junit.runners.model.FrameworkMethod method)
-
methodBlock
protected org.junit.runners.model.Statement methodBlock(org.junit.runners.model.FrameworkMethod method)
- Overrides:
methodBlock
in classorg.junit.runners.BlockJUnit4ClassRunner
-
beforeTest
protected void beforeTest(Sandbox sandbox, org.junit.runners.model.FrameworkMethod method, Method bootstrappedMethod) throws Throwable
- Throws:
Throwable
-
afterTest
protected void afterTest(org.junit.runners.model.FrameworkMethod method, Method bootstrappedMethod)
-
finallyAfterTest
protected void finallyAfterTest(org.junit.runners.model.FrameworkMethod method)
-
getHelperTestRunner
protected SandboxTestRunner.HelperTestRunner getHelperTestRunner(Class bootstrappedTestClass)
-
getExtraShadows
@Nonnull protected Class<?>[] getExtraShadows(org.junit.runners.model.FrameworkMethod method)
-
createClassHandler
@Nonnull protected ClassHandler createClassHandler(ShadowMap shadowMap, Sandbox sandbox)
-
withPotentialTimeout
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.- Overrides:
withPotentialTimeout
in classorg.junit.runners.BlockJUnit4ClassRunner
- See Also:
BlockJUnit4ClassRunner.methodInvoker(FrameworkMethod, Object)
,TimeLimitedStatement
-
-