public class SplitTestRunner
extends org.junit.runners.BlockJUnit4ClassRunner
Extension of standard JUnit 4 Runner Leverages Split* Testing Annotations to automate unit testing across various Feature Flag treatments Only one Annotation is respected per Test (IE Can not combine @SplitTest with @SplitScenarios on a single Test method)
| Constructor and Description |
|---|
SplitTestRunner(Class<?> klass)
Split Test Runner Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected List<org.junit.runners.model.FrameworkMethod> |
computeTestMethods()
Run tests in Alphabetical Order
|
protected org.junit.runner.Description |
describeChild(org.junit.runners.model.FrameworkMethod method)
Generate Test Description
|
Suite |
generateSuite(org.junit.runners.model.FrameworkMethod method) |
protected void |
runChild(org.junit.runners.model.FrameworkMethod method,
org.junit.runner.notification.RunNotifier notifier)
Run Suite of Scenarios for a Test
|
protected org.junit.runners.model.Statement |
withBefores(org.junit.runners.model.FrameworkMethod method,
Object target,
org.junit.runners.model.Statement statement)
Adds Split Application to the Test's Call Stack
|
collectInitializationErrors, createTest, getChildren, getTestRules, isIgnored, methodBlock, methodInvoker, possiblyExpectingExceptions, rules, testName, validateConstructor, validateFields, validateInstanceMethods, validateNoNonStaticInnerClass, validateOnlyOneConstructor, validateTestMethods, validateZeroArgConstructor, withAfters, withPotentialTimeoutpublic SplitTestRunner(Class<?> klass) throws org.junit.runners.model.InitializationError
Runner is instantiated by using the @RunWith(SplitTestRunner.class) annotation. Not to be called directly.
klass - The Test class to be runorg.junit.runners.model.InitializationError - Error occurred during class initializationprotected List<org.junit.runners.model.FrameworkMethod> computeTestMethods()
Runner is instantiated by using the @RunWith(SplitTestRunner.class) annotation. Not to be called directly.
computeTestMethods in class org.junit.runners.BlockJUnit4ClassRunnerprotected void runChild(org.junit.runners.model.FrameworkMethod method,
org.junit.runner.notification.RunNotifier notifier)
Generates a Suite of Scenarios and then runs the test once for each permutation. If no Scenarios are defined, or the only defined Scenario has no Tests set, Run test normally
runChild in class org.junit.runners.BlockJUnit4ClassRunnermethod - The Test function to be runnotifier - The notifier class tracking test executionprotected org.junit.runners.model.Statement withBefores(org.junit.runners.model.FrameworkMethod method,
Object target,
org.junit.runners.model.Statement statement)
This Override method first adds the application of Splits to run before the test execution. Then calls the SuperClass's method to add all @Before annotations to the call stack
This is required to ensure the Tested code is using the same SplitClient that the Runner is using.
withBefores in class org.junit.runners.BlockJUnit4ClassRunnerpublic Suite generateSuite(org.junit.runners.model.FrameworkMethod method)
protected org.junit.runner.Description describeChild(org.junit.runners.model.FrameworkMethod method)
If no Scenarios are on for that test, describe normally Otherwise Describe as a Suite of tests, showing the active splits for each Scenario in that run's description
describeChild in class org.junit.runners.BlockJUnit4ClassRunnermethod - The Test method to be runCopyright © 2019. All rights reserved.