public class FactoryRunner
extends org.junit.runners.BlockJUnit4ClassRunner
@RunWith(FactoryRunner.class)
to the JUnit test
to hook this helper to the JUnit test suite. When executing the test suite
with JUnit, all methods of the test suite that are annotated with TestFactory
will be executed before all other tests. Each of these methods dynamically
adds a number of JUnit tests to the test suite.Modifier and Type | Field and Description |
---|---|
protected java.util.LinkedList<org.junit.runners.model.FrameworkMethod> |
tests |
Constructor and Description |
---|
FactoryRunner(java.lang.Class<?> clazz) |
Modifier and Type | Method and Description |
---|---|
protected java.util.Collection<? extends org.junit.runners.model.FrameworkMethod> |
computeFactoryTests() |
protected java.util.List<org.junit.runners.model.FrameworkMethod> |
computeTestMethods() |
protected void |
computeTests() |
protected void |
validateInstanceMethods(java.util.List<java.lang.Throwable> errors)
This method overrides the original method
validateInstanceMethods(...)
of BlockJUnit4ClassRunner to avoid a crash of the JUnit test suite caused
by adding FactoryTest s to the test suite before pre-defined tests are loaded. |
collectInitializationErrors, createTest, describeChild, getChildren, getTestRules, isIgnored, methodBlock, methodInvoker, possiblyExpectingExceptions, rules, runChild, testName, validateConstructor, validateFields, validateNoNonStaticInnerClass, validateOnlyOneConstructor, validateTestMethods, validateZeroArgConstructor, withAfters, withBefores, withPotentialTimeout
public FactoryRunner(java.lang.Class<?> clazz) throws org.junit.runners.model.InitializationError
org.junit.runners.model.InitializationError
protected void computeTests() throws java.lang.Exception
java.lang.Exception
protected java.util.Collection<? extends org.junit.runners.model.FrameworkMethod> computeFactoryTests() throws java.lang.Exception
java.lang.Exception
protected java.util.List<org.junit.runners.model.FrameworkMethod> computeTestMethods()
computeTestMethods
in class org.junit.runners.BlockJUnit4ClassRunner
BlockJUnit4ClassRunner.computeTestMethods()
protected void validateInstanceMethods(java.util.List<java.lang.Throwable> errors)
validateInstanceMethods(...)
of BlockJUnit4ClassRunner
to avoid a crash of the JUnit test suite caused
by adding FactoryTest
s to the test suite before pre-defined tests are loaded.
The original method is marked @Deprecated
.
TODO: Remove this overriding method once the original is removed from the JUnit framework.validateInstanceMethods
in class org.junit.runners.BlockJUnit4ClassRunner