use of org.jbehave.core.reporters.StoryReporterBuilder in project jbehave-core by jbehave.
the class CoreStoryMaps method configuration.
@Override
public Configuration configuration() {
TableTransformers tableTransformers = new TableTransformers();
ExamplesTableFactory tableFactory = new ExamplesTableFactory(new LoadFromClasspath(this.getClass()), tableTransformers);
return new MostUsefulConfiguration().useStoryParser(new RegexStoryParser(tableFactory)).useStoryReporterBuilder(new StoryReporterBuilder().withCodeLocation(CodeLocations.codeLocationFromClass(this.getClass()))).useTableTransformers(tableTransformers);
}
use of org.jbehave.core.reporters.StoryReporterBuilder in project jbehave-core by jbehave.
the class MyStories method configuration.
@Override
public Configuration configuration() {
Class<? extends Embeddable> embeddableClass = this.getClass();
LoadFromClasspath resourceLoader = new LoadFromClasspath(embeddableClass);
TableTransformers tableTransformers = new TableTransformers();
ParameterControls parameterControls = new ParameterControls();
// Start from default ParameterConverters instance
ParameterConverters parameterConverters = new ParameterConverters(resourceLoader, tableTransformers);
// factory to allow parameter conversion and loading from external resources (used by StoryParser too)
ExamplesTableFactory examplesTableFactory = new ExamplesTableFactory(new LocalizedKeywords(), resourceLoader, parameterConverters, parameterControls, tableTransformers);
// add custom converters
parameterConverters.addConverters(new DateConverter(new SimpleDateFormat("yyyy-MM-dd")), new ExamplesTableConverter(examplesTableFactory));
return new MostUsefulConfiguration().useStoryLoader(resourceLoader).useStoryParser(new RegexStoryParser(examplesTableFactory)).useStoryReporterBuilder(new StoryReporterBuilder().withCodeLocation(CodeLocations.codeLocationFromClass(embeddableClass)).withDefaultFormats().withFormats(CONSOLE, TXT, HTML, XML)).useParameterConverters(parameterConverters).useParameterControls(parameterControls).useTableTransformers(tableTransformers);
}
use of org.jbehave.core.reporters.StoryReporterBuilder 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());
}
use of org.jbehave.core.reporters.StoryReporterBuilder in project jbehave-core by jbehave.
the class Embedder method generateReportsView.
public void generateReportsView() {
StoryReporterBuilder builder = configuration().storyReporterBuilder();
File outputDirectory = builder.outputDirectory();
List<String> formatNames = builder.formatNames(true);
generateReportsView(outputDirectory, formatNames, builder.viewResources());
}
use of org.jbehave.core.reporters.StoryReporterBuilder in project jbehave-core by jbehave.
the class Embedder method generateMapsView.
private void generateMapsView(StoryMaps storyMaps) {
Configuration configuration = configuration();
StoryReporterBuilder builder = configuration.storyReporterBuilder();
File outputDirectory = builder.outputDirectory();
Properties viewResources = builder.viewResources();
ViewGenerator viewGenerator = configuration.viewGenerator();
try {
embedderMonitor.generatingMapsView(outputDirectory, storyMaps, viewResources);
viewGenerator.generateMapsView(outputDirectory, storyMaps, viewResources);
} catch (RuntimeException e) {
embedderMonitor.mapsViewGenerationFailed(outputDirectory, storyMaps, viewResources, e);
throw new ViewGenerationFailed(outputDirectory, storyMaps, viewResources, e);
}
}
Aggregations