use of org.jbehave.core.reporters.FilePrintStreamFactory.ResolveToSimpleName in project jbehave-core by jbehave.
the class FilePrintStreamFactoryBehaviour method shouldResolveOutputNameFromStoryLocationWithSimpleNameResolver.
@Test
public void shouldResolveOutputNameFromStoryLocationWithSimpleNameResolver() {
FilePathResolver resolver = new ResolveToSimpleName();
assertThatOutputNameIs("org/jbehave/examples/trader/stories/my_given.story", "my_given.ext", resolver);
assertThatOutputNameIs("/org/jbehave/examples/trader/stories/my_given.story", "my_given.ext", resolver);
assertThatOutputNameIs("my_given.story", "my_given.ext", resolver);
assertThatOutputNameIs("my_given", "my_given.ext", resolver);
}
use of org.jbehave.core.reporters.FilePrintStreamFactory.ResolveToSimpleName in project jbehave-core by jbehave.
the class LocalizedStories method configuration.
@Override
public Configuration configuration() {
ClassLoader classLoader = this.getClass().getClassLoader();
URL codeLocation = CodeLocations.codeLocationFromClass(this.getClass());
Keywords keywords = new LocalizedKeywords(locale());
Properties properties = new Properties();
properties.setProperty("reports", "ftl/jbehave-reports.ftl");
properties.setProperty("encoding", "UTF-8");
LoadFromClasspath resourceLoader = new LoadFromClasspath(classLoader);
TableTransformers tableTransformers = new TableTransformers();
ParameterControls parameterControls = new ParameterControls();
ParameterConverters parameterConverters = new ParameterConverters(resourceLoader, parameterControls, tableTransformers, true).addConverters(customConverters(keywords, resourceLoader, tableTransformers));
return new MostUsefulConfiguration().useKeywords(keywords).useStepCollector(new MarkUnmatchedStepsAsPending(keywords)).useStoryParser(new RegexStoryParser(keywords, resourceLoader, tableTransformers)).useStoryLoader(resourceLoader).useStoryReporterBuilder(new StoryReporterBuilder().withCodeLocation(codeLocation).withPathResolver(new ResolveToSimpleName()).withDefaultFormats().withFormats(CONSOLE, TXT, HTML, XML).withFailureTrace(false).withViewResources(properties).withKeywords(keywords)).useParameterConverters(parameterConverters).useParameterControls(parameterControls).useTableTransformers(tableTransformers);
}
use of org.jbehave.core.reporters.FilePrintStreamFactory.ResolveToSimpleName in project jbehave-core by jbehave.
the class CoreStoriesUsingURLs method configuration.
@Override
public Configuration configuration() {
Configuration configuration = super.configuration();
StoryReporterBuilder builder = configuration.storyReporterBuilder();
builder.withPathResolver(new ResolveToSimpleName());
return configuration.useStoryLoader(new LoadFromURL());
}
Aggregations