org.jbehave.core
Class AbstractStory

java.lang.Object
  extended by org.jbehave.core.AbstractStory
All Implemented Interfaces:
RunnableStory
Direct Known Subclasses:
JUnitStories.JUnitStoriesDelegate, JUnitStory.JUnitStoryDelegate

public abstract class AbstractStory
extends Object
implements RunnableStory

Abstract implementation of RunnableStory which is intended as a base class for delegate implementations of RunnableStory. As such, it has no explicit supports for any test framework, i.e. it requires the RunnableStory.runStory() method to be invoked directly, and the class of the story being run needs to be provided explicitly. The RunnableStory.runStory() method then uses the StoryRunner to run the story or stories, using the provided StoryConfiguration and the CandidateSteps.

Typically, users will find it easier to extend decorator stories, such as JUnitStory or JUnitStories which also provide support for test frameworks and also provide the story class or story paths being implemented by the user.


Constructor Summary
protected AbstractStory()
           
protected AbstractStory(StoryRunner storyRunner, Class<? extends RunnableStory> storyClass)
           
protected AbstractStory(StoryRunner storyRunner, List<String> storyPaths)
           
 
Method Summary
 void addSteps(CandidateSteps... steps)
           
 void generateStepdoc()
           
 StoryConfiguration getConfiguration()
           
 List<CandidateSteps> getSteps()
           
 void runStory()
           
 void useConfiguration(StoryConfiguration configuration)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractStory

protected AbstractStory()

AbstractStory

protected AbstractStory(StoryRunner storyRunner,
                        Class<? extends RunnableStory> storyClass)

AbstractStory

protected AbstractStory(StoryRunner storyRunner,
                        List<String> storyPaths)
Method Detail

runStory

public void runStory()
              throws Throwable
Specified by:
runStory in interface RunnableStory
Throws:
Throwable

useConfiguration

public void useConfiguration(StoryConfiguration configuration)
Specified by:
useConfiguration in interface RunnableStory

getConfiguration

public StoryConfiguration getConfiguration()
Specified by:
getConfiguration in interface RunnableStory

addSteps

public void addSteps(CandidateSteps... steps)
Specified by:
addSteps in interface RunnableStory

getSteps

public List<CandidateSteps> getSteps()
Specified by:
getSteps in interface RunnableStory

generateStepdoc

public void generateStepdoc()
Specified by:
generateStepdoc in interface RunnableStory


Copyright © 2003-2010. All Rights Reserved.