public class ContractTestRunner
extends org.junit.runners.BlockJUnit4ClassRunner
| Constructor and Description |
|---|
ContractTestRunner(Class<?> testClass)
Create a test runner for stand alone test
|
ContractTestRunner(Object getterObj,
TestInfo parentTestInfo,
TestInfo testInfo)
Create a test runner within the ContractTestSuite.
|
| Modifier and Type | Method and Description |
|---|---|
protected List<org.junit.runners.model.FrameworkMethod> |
computeTestMethods()
Returns the methods that run tests.
|
protected Object |
createTest()
Create the concrete class passing it the producer instance from the
getter class.
|
protected org.junit.runner.Description |
describeChild(org.junit.runners.model.FrameworkMethod method) |
protected String |
getName()
Returns a name used to describe this Runner
|
protected void |
validateConstructor(List<Throwable> errors)
Adds to
errors if the test class has more than one constructor,
or if the constructor takes parameters. |
collectInitializationErrors, getChildren, getTestRules, methodBlock, methodInvoker, possiblyExpectingExceptions, rules, runChild, testName, validateFields, validateInstanceMethods, validateNoNonStaticInnerClass, validateOnlyOneConstructor, validateTestMethods, validateZeroArgConstructor, withAfters, withBefores, withPotentialTimeoutpublic ContractTestRunner(Object getterObj, TestInfo parentTestInfo, TestInfo testInfo) throws org.junit.runners.model.InitializationError
getterObj - The object on which we will execute the method that gets the
producer.parentTestInfo - The test info for the parent.testInfo - The test info for this test.org.junit.runners.model.InitializationError - on error.public ContractTestRunner(Class<?> testClass) throws org.junit.runners.model.InitializationError
testClass - The ContractTest annoated class.org.junit.runners.model.InitializationError - on error.protected Object createTest() throws InstantiationException, IllegalAccessException, InvocationTargetException
createTest in class org.junit.runners.BlockJUnit4ClassRunnerInvocationTargetException - if the testClass can not be initialized with
newInstance()IllegalArgumentException - if any of the classes can not be initialized or the dynamic
method can not be called.InvocationTargetException - if any of the classes can not be initialized or the dynamic
method can not be called.InstantiationExceptionIllegalAccessExceptionprotected void validateConstructor(List<Throwable> errors)
errors if the test class has more than one constructor,
or if the constructor takes parameters. Override if a subclass requires
different validation rules.validateConstructor in class org.junit.runners.BlockJUnit4ClassRunnerprotected String getName()
getName in class org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>protected org.junit.runner.Description describeChild(org.junit.runners.model.FrameworkMethod method)
describeChild in class org.junit.runners.BlockJUnit4ClassRunnerprotected List<org.junit.runners.model.FrameworkMethod> computeTestMethods()
@Test on this class and superclasses that
are not overridden.computeTestMethods in class org.junit.runners.BlockJUnit4ClassRunnerCopyright © 2013-2016 XENEI.com. All Rights Reserved.