org.jbehave.scenario
Class MostUsefulConfiguration

java.lang.Object
  extended by org.jbehave.scenario.MostUsefulConfiguration
All Implemented Interfaces:
Configuration

public class MostUsefulConfiguration
extends java.lang.Object
implements Configuration

The default configuration used by ScenarioRunner. Works for most situations that users are likely to encounter. The default elements configured are:


Constructor Summary
MostUsefulConfiguration()
           
 
Method Summary
 StepCreator forCreatingSteps()
          Provides pending steps where unmatched steps exist.
 ScenarioDefiner forDefiningScenarios()
          Defines scenarios by looking for a file named after the scenario and in the same package, using lower-case underscored name in place of the camel-cased name - so MyScenario.java maps to my_scenario.
 StepdocGenerator forGeneratingStepdoc()
          Generates stepdocs
 ErrorStrategy forHandlingErrors()
          Handles errors by rethrowing them.
 PendingErrorStrategy forPendingSteps()
          Allows pending steps to pass, so that builds etc.
 ScenarioReporter forReportingScenarios()
          Reports failing or pending scenarios to System.out, while silently passing scenarios.
 StepdocReporter forReportingStepdoc()
          Reports stepdocs to System.out
 KeyWords keywords()
          Provides the keywords in English
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MostUsefulConfiguration

public MostUsefulConfiguration()
Method Detail

forCreatingSteps

public StepCreator forCreatingSteps()
Provides pending steps where unmatched steps exist.

Specified by:
forCreatingSteps in interface Configuration

forDefiningScenarios

public ScenarioDefiner forDefiningScenarios()
Defines scenarios by looking for a file named after the scenario and in the same package, using lower-case underscored name in place of the camel-cased name - so MyScenario.java maps to my_scenario.

Specified by:
forDefiningScenarios in interface Configuration

forHandlingErrors

public ErrorStrategy forHandlingErrors()
Handles errors by rethrowing them.

If there are multiple scenarios in a single story definition, this could cause the story to stop after the first failing scenario.

If you want different behaviour, you might want to look at the ErrorStrategyInWhichWeTrustTheReporter.

Specified by:
forHandlingErrors in interface Configuration

forPendingSteps

public PendingErrorStrategy forPendingSteps()
Allows pending steps to pass, so that builds etc. will not fail.

If you want to spot pending steps, you might want to look at PendingStepStrategy.FAILING, or alternatively at the PropertyBasedConfiguration which provides a mechanism for altering this behaviour in different environments.

Specified by:
forPendingSteps in interface Configuration

forReportingScenarios

public ScenarioReporter forReportingScenarios()
Reports failing or pending scenarios to System.out, while silently passing scenarios.

If you want different behaviour, you might like to use the PrintStreamScenarioReporter, or look at the PropertyBasedConfiguration which provides a mechanism for altering this behaviour in different environments.

Specified by:
forReportingScenarios in interface Configuration

keywords

public KeyWords keywords()
Provides the keywords in English

Specified by:
keywords in interface Configuration

forGeneratingStepdoc

public StepdocGenerator forGeneratingStepdoc()
Generates stepdocs

Specified by:
forGeneratingStepdoc in interface Configuration

forReportingStepdoc

public StepdocReporter forReportingStepdoc()
Reports stepdocs to System.out

Specified by:
forReportingStepdoc in interface Configuration


Copyright © 2003-2010. All Rights Reserved.