Class FactoryRunner
java.lang.Object
org.junit.runner.Runner
org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>
org.junit.runners.BlockJUnit4ClassRunner
org.processmining.contexts.test.factory.FactoryRunner
- All Implemented Interfaces:
org.junit.runner.Describable
,org.junit.runner.manipulation.Filterable
,org.junit.runner.manipulation.Sortable
public class FactoryRunner
extends org.junit.runners.BlockJUnit4ClassRunner
A helper method that can be used to modify how JUnit executes a test suite.
Add annotation
@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.- Author:
- Ted Young
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<? extends org.junit.runners.model.FrameworkMethod>
protected List<org.junit.runners.model.FrameworkMethod>
protected void
protected void
validateInstanceMethods
(List<Throwable> errors) This method overrides the original methodvalidateInstanceMethods(...)
ofBlockJUnit4ClassRunner
to avoid a crash of the JUnit test suite caused by addingFactoryTest
s to the test suite before pre-defined tests are loaded.Methods inherited from class org.junit.runners.BlockJUnit4ClassRunner
collectInitializationErrors, createTest, describeChild, getChildren, getTestRules, isIgnored, methodBlock, methodInvoker, possiblyExpectingExceptions, rules, runChild, testName, validateConstructor, validateFields, validateNoNonStaticInnerClass, validateOnlyOneConstructor, validateTestMethods, validateZeroArgConstructor, withAfters, withBefores, withPotentialTimeout
Methods inherited from class org.junit.runners.ParentRunner
childrenInvoker, classBlock, classRules, createTestClass, filter, getDescription, getName, getRunnerAnnotations, getTestClass, run, runLeaf, setScheduler, sort, validatePublicVoidNoArgMethods, withAfterClasses, withBeforeClasses
Methods inherited from class org.junit.runner.Runner
testCount
-
Field Details
-
tests
-
-
Constructor Details
-
FactoryRunner
- Throws:
org.junit.runners.model.InitializationError
-
-
Method Details
-
computeTests
- Throws:
Exception
-
computeFactoryTests
protected Collection<? extends org.junit.runners.model.FrameworkMethod> computeFactoryTests() throws Exception- Throws:
Exception
-
computeTestMethods
- Overrides:
computeTestMethods
in classorg.junit.runners.BlockJUnit4ClassRunner
- See Also:
-
BlockJUnit4ClassRunner.computeTestMethods()
-
validateInstanceMethods
This method overrides the original methodvalidateInstanceMethods(...)
ofBlockJUnit4ClassRunner
to avoid a crash of the JUnit test suite caused by addingFactoryTest
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.- Overrides:
validateInstanceMethods
in classorg.junit.runners.BlockJUnit4ClassRunner
-