cucumber.junit
Class Cucumber

java.lang.Object
  extended by org.junit.runner.Runner
      extended by org.junit.runners.ParentRunner<FeatureRunner>
          extended by cucumber.junit.Cucumber
All Implemented Interfaces:
org.junit.runner.Describable, org.junit.runner.manipulation.Filterable, org.junit.runner.manipulation.Sortable

public class Cucumber
extends org.junit.runners.ParentRunner<FeatureRunner>

Classes annotated with @RunWith(Cucumber.class) will run a Cucumber Feature. The class should be empty without any fields or methods.

Cucumber will look for a .feature file on the classpath, using the same resource path as the annotated class (.class substituted by .feature).

Additional hints can be given to Cucumber by annotating the class with Cucumber.Options.

See Also:
Cucumber.Options

Nested Class Summary
static interface Cucumber.Options
          This annotation can be used to give additional hints to the Cucumber runner about what to run.
 
Constructor Summary
Cucumber(Class clazz)
          Constructor called by JUnit.
 
Method Summary
protected  org.junit.runner.Description describeChild(FeatureRunner child)
           
protected  List<FeatureRunner> getChildren()
           
 void run(org.junit.runner.notification.RunNotifier notifier)
           
protected  void runChild(FeatureRunner child, org.junit.runner.notification.RunNotifier notifier)
           
 
Methods inherited from class org.junit.runners.ParentRunner
childrenInvoker, classBlock, classRules, collectInitializationErrors, filter, getDescription, getName, getRunnerAnnotations, getTestClass, 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

Cucumber

public Cucumber(Class clazz)
         throws org.junit.runners.model.InitializationError,
                IOException
Constructor called by JUnit.

Parameters:
clazz - the class with the @RunWith annotation.
Throws:
IOException - if there is a problem
org.junit.runners.model.InitializationError - if there is another problem
Method Detail

getChildren

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

describeChild

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

runChild

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

run

public void run(org.junit.runner.notification.RunNotifier notifier)
Overrides:
run in class org.junit.runners.ParentRunner<FeatureRunner>


Copyright © 2012. All Rights Reserved.