public class SpincastJUnitRunner
extends org.junit.runners.BlockJUnit4ClassRunner
If the test class implements IBeforeAfterClassMethodsProvider,
"beforeClass()" and "afterClass()" will be called on it.
You can also annotate the test class with ExpectingInstanciationException:
then the instantiation of the class will be expected to fail. If such an exception is
expected and does occure, the tests won't be run. Note that Junit requires at
least one test method to be present, so if @ExpectingInstanciationException
is used, we dynamically add the "hashcode()" method, always available on each object, as a
dummy "test" method.
| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
logger |
| Constructor and Description |
|---|
SpincastJUnitRunner(Class<?> klass) |
| Modifier and Type | Method and Description |
|---|---|
protected List<org.junit.runners.model.FrameworkMethod> |
computeTestMethods()
If the class is annotated with @ExpectingInstanciationException
no @Test method are required.
|
Object |
createTest() |
boolean |
isExpectingInstanciationException() |
protected org.junit.runners.model.Statement |
methodBlock(org.junit.runners.model.FrameworkMethod method)
If an instanciation exception occured, we don't run the
actual tests!
|
void |
run(org.junit.runner.notification.RunNotifier notifier) |
collectInitializationErrors, describeChild, getChildren, getTestRules, isIgnored, methodInvoker, possiblyExpectingExceptions, rules, runChild, testName, validateConstructor, validateFields, validateInstanceMethods, validateNoNonStaticInnerClass, validateOnlyOneConstructor, validateTestMethods, validateZeroArgConstructor, withAfters, withBefores, withPotentialTimeoutpublic SpincastJUnitRunner(Class<?> klass) throws org.junit.runners.model.InitializationError
org.junit.runners.model.InitializationErrorpublic boolean isExpectingInstanciationException()
public Object createTest() throws Exception
createTest in class org.junit.runners.BlockJUnit4ClassRunnerExceptionprotected List<org.junit.runners.model.FrameworkMethod> computeTestMethods()
computeTestMethods in class org.junit.runners.BlockJUnit4ClassRunnerprotected org.junit.runners.model.Statement methodBlock(org.junit.runners.model.FrameworkMethod method)
methodBlock in class org.junit.runners.BlockJUnit4ClassRunnerpublic void run(org.junit.runner.notification.RunNotifier notifier)
run in class org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>Copyright © 2016. All rights reserved.