com.tngtech.jgiven.impl
Class ScenarioExecutor

java.lang.Object
  extended by com.tngtech.jgiven.impl.ScenarioExecutor

public class ScenarioExecutor
extends Object

Main class of JGiven for executing scenarios


Nested Class Summary
static class ScenarioExecutor.State
           
 
Constructor Summary
ScenarioExecutor()
           
 
Method Summary
 void addIntroWord(String word)
           
<T> T
addStage(Class<T> stepsClass)
           
 void failed(Throwable e)
           
 void finished()
          Has to be called when the scenario is finished in order to execute after methods
 void injectSteps(Object stage)
           
 void readScenarioState(Object object)
           
 void setListener(ScenarioListener listener)
           
 void startScenario(Method method, List<?> arguments)
          Starts the scenario with the given method and arguments.
 void startScenario(String description)
          Starts a scenario with the given description.
 void succeeded()
           
 void wireSteps(CanWire canWire)
          Used for DI frameworks to inject values into stages
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScenarioExecutor

public ScenarioExecutor()
Method Detail

addStage

public <T> T addStage(Class<T> stepsClass)

addIntroWord

public void addIntroWord(String word)

readScenarioState

public void readScenarioState(Object object)

wireSteps

public void wireSteps(CanWire canWire)
Used for DI frameworks to inject values into stages


finished

public void finished()
              throws Throwable
Has to be called when the scenario is finished in order to execute after methods

Throws:
Throwable

injectSteps

public void injectSteps(Object stage)

succeeded

public void succeeded()

failed

public void failed(Throwable e)

startScenario

public void startScenario(String description)
Starts a scenario with the given description.

Parameters:
description - the description of the scenario

startScenario

public void startScenario(Method method,
                          List<?> arguments)
Starts the scenario with the given method and arguments. Derives the description from the method name.

Parameters:
method - the method that started the scenario
arguments - the arguments of the method invocation

setListener

public void setListener(ScenarioListener listener)


Copyright © 2014 TNG Technology Consulting. All rights reserved.