Hi Andreas,
in StoryRunner you'll find the method that does the parsing based on the
configuration and story path:
public Story storyOfPath(Configuration configuration, String
storyPath) {
String storyAsText =
configuration.storyLoader().loadStoryAsText(storyPath);
return configuration.storyParser().parseStory(storyAsText,
storyPath);
}
Cheers
On 04/10/2013 10:08, Andreas Ebbert-Karroum wrote:
Hi,
as Hans correctly pointed out in a recent post, the
jbehave-junit-runner currently ignores the given stories. I agree that
this is a feature, that is desireable to have. When we wrote the
extension to JBehave, we have not implemented that, since we thought -
and still think - that the jbehave-junit-runner provided enough value
to be released. But the time has come to think about including that
feature.
Now, the way the jbehave-junit-runner works is that it needs to know
all stories, scenarios and steps, before the execution starts, in
order to forward that information to JUnit, so that it knows how many
and which tests to expect.
I do have access to the Story object, but from there I "only" get the
given stories as paths and probably need to parse them myself. Can
somebody point me to some source code in the original JBehave sources
how that should be done best?
Here's the class that generates the JUnit description objects:
https://github.com/codecentric/jbehave-junit-runner/blob/master/src/main/java/de/codecentric/jbehave/junit/monitoring/JUnitDescriptionGenerator.java
The method should include a addAllGivenStories(...) in between.
public Description createDescriptionFrom(Story story) {
Description storyDescription = createDescriptionForStory(story);
addAllScenariosToDescription(story, storyDescription);
return storyDescription;
}
Thanks for your help!
--
Mit freundlichen Grüßen / Best regards
Andreas Ebbert-Karroum | Agile Principal Consultant
codecentric AG | Merscheider Straße 1 | 42699 Solingen | Deutschland
tel: +49 (0) 212.23362825 | fax: +49 (0) 212.23362879 | mobil: +49 (0)
175.2664109
www.codecentric.de <http://www.codecentric.de> | blog.codecentric.de
<http://blog.codecentric.de> | www.meettheexperts.de
<http://www.meettheexperts.de> | www.more4fi.de <http://www.more4fi.de>
Sitz der Gesellschaft: Düsseldorf | HRB 63043
Vorstand: Klaus Jäger (Vorsitzender) . Michael Hochgürtel . Mirko
Novakovic . Rainer Vehns
Aufsichtsrat: Patric Fedlmeier (Vorsitzender) . Bernd Klinkmann .
Jürgen Schütz
Diese E-Mail einschließlich evtl. beigefügter Dateien enthält
vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie
nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten
haben, informieren Sie bitte sofort den Absender und löschen Sie diese
E-Mail und evtl. beigefügter Dateien umgehend. Das unerlaubte
Kopieren, Nutzen oder Öffnen evtl. beigefügter Dateien sowie die
unbefugte Weitergabe dieser E-Mail ist nicht gestattet.