com.atlassian.jira.functest.framework.suite
Class TransformingParentRunner<T>

java.lang.Object
  extended by org.junit.runner.Runner
      extended by org.junit.runners.ParentRunner<T>
          extended by com.atlassian.jira.functest.framework.suite.TransformingParentRunner<T>
All Implemented Interfaces:
org.junit.runner.Describable, org.junit.runner.manipulation.Filterable, org.junit.runner.manipulation.Sortable

public class TransformingParentRunner<T>
extends org.junit.runners.ParentRunner<T>

A parent runner implementation that wraps another parent runner and applies an ordered list of transforms over the wrapped runner children, such that only the resulting list of children will be run.

The transforms operate on input list of descriptions and return a new copy of this list with any necessary modifications. Only corresponding children of the descriptions will be executed by this runner. The transforms get applied recursively over the whole runner tree.

Since:
v4.4
See Also:
SuiteTransform

Constructor Summary
TransformingParentRunner(org.junit.runners.ParentRunner<T> original, Iterable<SuiteTransform> transforms)
           
TransformingParentRunner(String name, org.junit.runners.ParentRunner<T> original, Iterable<SuiteTransform> transforms)
           
 
Method Summary
static List<org.junit.runner.Description> applyTransforms(Iterable<org.junit.runner.Description> input, Iterable<SuiteTransform> transforms)
           
protected  org.junit.runner.Description describeChild(T child)
           
protected  List<T> getChildren()
           
 org.junit.runner.Description getDescription()
           
protected  String getName()
           
protected  void runChild(T child, org.junit.runner.notification.RunNotifier notifier)
           
protected  org.junit.runners.ParentRunner<?> wrap(org.junit.runners.ParentRunner<?> original, List<SuiteTransform> transforms)
           Wrap child of this runner that itself is parent runner in an instance that will provide transformations over its children (if necessary).
 
Methods inherited from class org.junit.runners.ParentRunner
childrenInvoker, classBlock, classRules, collectInitializationErrors, filter, getRunnerAnnotations, getTestClass, run, runLeaf, setScheduler, sort, validatePublicVoidNoArgMethods, withAfterClasses, withBeforeClasses
 
Methods inherited from class org.junit.runner.Runner
testCount
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransformingParentRunner

public TransformingParentRunner(String name,
                                org.junit.runners.ParentRunner<T> original,
                                Iterable<SuiteTransform> transforms)
                         throws org.junit.runners.model.InitializationError
Throws:
org.junit.runners.model.InitializationError

TransformingParentRunner

public TransformingParentRunner(org.junit.runners.ParentRunner<T> original,
                                Iterable<SuiteTransform> transforms)
                         throws org.junit.runners.model.InitializationError
Throws:
org.junit.runners.model.InitializationError
Method Detail

applyTransforms

public static List<org.junit.runner.Description> applyTransforms(Iterable<org.junit.runner.Description> input,
                                                                 Iterable<SuiteTransform> transforms)

wrap

protected org.junit.runners.ParentRunner<?> wrap(org.junit.runners.ParentRunner<?> original,
                                                 List<SuiteTransform> transforms)
                                          throws org.junit.runners.model.InitializationError

Wrap child of this runner that itself is parent runner in an instance that will provide transformations over its children (if necessary).

Override this method to handle specific parent runner subclasses that override its protected or public methods, linke e.g. ParentRunner.run(org.junit.runner.notification.RunNotifier). Otherwise this class will break those runners.

Parameters:
original - original runner instance
transforms - list of transforms
Returns:
wrapping instance that will provide transforms over that particular instance
Throws:
org.junit.runners.model.InitializationError - runner initialization error

getChildren

protected List<T> getChildren()
Specified by:
getChildren in class org.junit.runners.ParentRunner<T>

describeChild

protected org.junit.runner.Description describeChild(T child)
Specified by:
describeChild in class org.junit.runners.ParentRunner<T>

runChild

protected void runChild(T child,
                        org.junit.runner.notification.RunNotifier notifier)
Specified by:
runChild in class org.junit.runners.ParentRunner<T>

getDescription

public org.junit.runner.Description getDescription()
Specified by:
getDescription in interface org.junit.runner.Describable
Overrides:
getDescription in class org.junit.runners.ParentRunner<T>

getName

protected String getName()
Overrides:
getName in class org.junit.runners.ParentRunner<T>


Copyright © 2002-2013 Atlassian. All Rights Reserved.