我需要將mystory.story文件和MyStory.java放在不同的文件夾中。下面是我的配置,如何從JBehave中的不同文件夾加載故事文件
@Override
public Configuration configuration() {
return new MostUsefulConfiguration()
// where to find the stories
.useStoryLoader(new LoadFromClasspath(this.getClass()))
// CONSOLE and TXT reporting
.useStoryReporterBuilder(
new StoryReporterBuilder().withDefaultFormats()
.withFormats(Format.CONSOLE, Format.HTML));
}
// Here we specify the steps classes
@Override
public List<CandidateSteps> candidateSteps() {
// varargs, can have more that one steps classes
return new InstanceStepsFactory(configuration(), new SurveySteps())
.createCandidateSteps();
}
這就是我需要使用的文件夾結構
test
|_config
|_MyStory.java
|_stories
|_my_Story.story
代替,
test
|_MyStory.java
|_my_Story.story
我怎樣才能實現呢?
您是繼承'JunitStories' /'JunitStory'嗎? – Katona