The format for a JBehave story is as follows:
Syntax of the XP Story in JBehave
Story: <story name>
As a <role name>
I want to <function>
so that <business value>
Acceptance Criteria: <Acceptance Criteria name>
{optional}Given <context>
When <action>
Then <outcomes>
There can be any number of acceptance criteria for a story.
<context> = {optional} <full acceptance criteria name>, <givens> [<comment>] * n separated by “and”
<outcomes> = <outcome> [<comment>] * n separated by “and”
<full acceptance criteria name> = <acceptance criteria name> {optional} from <story name>
Posted by chrismatts at November 30, 2004 5:00 PMIt sort of answers my question, but I think I've missed something. What I'm doing is using the story format you have specified, to write a small JAVA program to read in the story using the SimpleStoryParser class.
see below :-
try
{
FileReader f = new FileReader("atm.txt");
SimpleStoryParser sp = new SimpleStoryParser();
StoryDetails sd = sp.parseStory(f);
// Print out some stuff out.
System.out.println("ToString : "+sd.toString());
System.out.println("Benefit : "+sd.benefit());
System.out.println("Feature : "+sd.feature());
}
catch (FileNotFoundException e)
{
System.out.println(e);
}
}
However, I'm not entirely sure how you then produce the behavior class stubs from here. I've had a look at http://jbehave.codehaus.org/ but to no avail. I found your blog outlining the story format where you said you can then produce the behavior class stubs using Jbehave, but to no avail. What step I'm I missing? What to I need to call something in the API to create the stubs ? Or is there a utility program to do the work for me ?
Thank you
Jim
Posted by: James Fisk at December 10, 2004 8:29 PM