org.jnario.runner
Class ExampleGroupRunner

java.lang.Object
  extended by org.junit.runner.Runner
      extended by org.junit.runners.ParentRunner<org.junit.runner.Runner>
          extended by org.jnario.runner.ExampleGroupRunner
All Implemented Interfaces:
org.junit.runner.Describable, org.junit.runner.manipulation.Filterable, org.junit.runner.manipulation.Sortable
Direct Known Subclasses:
FeatureRunner

public class ExampleGroupRunner
extends org.junit.runners.ParentRunner<org.junit.runner.Runner>

The Jnario spec Runner features full text descriptions for tests and classes annotated with Named. It combines the functionality of a BlockJUnit4ClassRunner with a Suite to enable nesting specs and facts. Nested specs can be declared using the Contains annotation.

Author:
Sebastian Benz - Initial contribution and API

Constructor Summary
ExampleGroupRunner(Class<?> testClass)
           
ExampleGroupRunner(Class<?> testClass, NameProvider nameProvider, Set<Method> setups)
           
 
Method Summary
protected  Iterable<? extends Class<?>> allContainedClasses()
           
protected  List<Class<?>> allDeclaredClasses()
           
protected  List<org.junit.rules.TestRule> classRules()
           
protected  Iterable<? extends org.junit.runner.Runner> collectExampleGroups()
           
protected  Iterable<? extends org.junit.runner.Runner> collectExamples()
           
protected  org.junit.runner.Runner createExampleGroupRunner(Class<?> declaredClass)
           
protected  ExampleRunner createExampleRunner(Class<?> testClass, org.junit.runners.model.FrameworkMethod from)
           
protected  Iterable<? extends org.junit.runner.Runner> createRunners(Class<?> testClass, List<org.junit.runners.model.FrameworkMethod> annotatedMethods)
           
protected  SpecCreator createTestInstantiator()
           
protected  org.junit.runner.Description describeChild(org.junit.runner.Runner child)
           
 List<org.junit.runners.model.FrameworkMethod> filterAlreadyScheduled(List<org.junit.runners.model.FrameworkMethod> befores)
           
protected  List<org.junit.runner.Runner> getChildren()
           
protected  CreateWith getCreateWithAnnotation()
           
protected  List<ExtensionClass> getExtensions()
           
protected  String getName()
           
protected  NameProvider getNameProvider()
           
protected  com.google.common.base.Predicate<org.junit.runners.model.FrameworkMethod> isTestMethod()
           
protected  void orderMethods(List<org.junit.runners.model.FrameworkMethod> annotatedMethods)
           
protected  void runChild(org.junit.runner.Runner child, org.junit.runner.notification.RunNotifier notifier)
           
protected  Class<?> targetClass()
           
protected  org.junit.runners.model.Statement withAfterClasses(org.junit.runners.model.Statement statement)
           
protected  org.junit.runners.model.Statement withBeforeClasses(org.junit.runners.model.Statement statement)
           
 
Methods inherited from class org.junit.runners.ParentRunner
childrenInvoker, classBlock, collectInitializationErrors, filter, getDescription, getRunnerAnnotations, getTestClass, run, runLeaf, setScheduler, sort, validatePublicVoidNoArgMethods
 
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

ExampleGroupRunner

public ExampleGroupRunner(Class<?> testClass)
                   throws org.junit.runners.model.InitializationError
Throws:
org.junit.runners.model.InitializationError

ExampleGroupRunner

public ExampleGroupRunner(Class<?> testClass,
                          NameProvider nameProvider,
                          Set<Method> setups)
                   throws org.junit.runners.model.InitializationError
Throws:
org.junit.runners.model.InitializationError
Method Detail

getName

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

getChildren

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

getNameProvider

protected NameProvider getNameProvider()

collectExamples

protected Iterable<? extends org.junit.runner.Runner> collectExamples()

isTestMethod

protected com.google.common.base.Predicate<org.junit.runners.model.FrameworkMethod> isTestMethod()

createRunners

protected Iterable<? extends org.junit.runner.Runner> createRunners(Class<?> testClass,
                                                                    List<org.junit.runners.model.FrameworkMethod> annotatedMethods)

orderMethods

protected void orderMethods(List<org.junit.runners.model.FrameworkMethod> annotatedMethods)

createExampleRunner

protected ExampleRunner createExampleRunner(Class<?> testClass,
                                            org.junit.runners.model.FrameworkMethod from)
                                     throws org.junit.runners.model.InitializationError,
                                            org.junit.runner.manipulation.NoTestsRemainException
Throws:
org.junit.runners.model.InitializationError
org.junit.runner.manipulation.NoTestsRemainException

createTestInstantiator

protected SpecCreator createTestInstantiator()
                                      throws org.junit.runners.model.InitializationError
Throws:
org.junit.runners.model.InitializationError

getCreateWithAnnotation

protected CreateWith getCreateWithAnnotation()

collectExampleGroups

protected Iterable<? extends org.junit.runner.Runner> collectExampleGroups()

createExampleGroupRunner

protected org.junit.runner.Runner createExampleGroupRunner(Class<?> declaredClass)
                                                    throws org.junit.runners.model.InitializationError
Throws:
org.junit.runners.model.InitializationError

allDeclaredClasses

protected List<Class<?>> allDeclaredClasses()

allContainedClasses

protected Iterable<? extends Class<?>> allContainedClasses()

targetClass

protected Class<?> targetClass()

describeChild

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

runChild

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

classRules

protected List<org.junit.rules.TestRule> classRules()
Overrides:
classRules in class org.junit.runners.ParentRunner<org.junit.runner.Runner>

withBeforeClasses

protected org.junit.runners.model.Statement withBeforeClasses(org.junit.runners.model.Statement statement)
Overrides:
withBeforeClasses in class org.junit.runners.ParentRunner<org.junit.runner.Runner>

withAfterClasses

protected org.junit.runners.model.Statement withAfterClasses(org.junit.runners.model.Statement statement)
Overrides:
withAfterClasses in class org.junit.runners.ParentRunner<org.junit.runner.Runner>

filterAlreadyScheduled

public List<org.junit.runners.model.FrameworkMethod> filterAlreadyScheduled(List<org.junit.runners.model.FrameworkMethod> befores)

getExtensions

protected List<ExtensionClass> getExtensions()


Copyright © 2012-2013 BMW Car IT. All Rights Reserved.