use of org.jbehave.core.reporters.CrossReference in project jbehave-core by jbehave.
the class CoreEmbedder method configuration.
@Override
public Configuration configuration() {
Class<? extends CoreEmbedder> embedderClass = this.getClass();
TableTransformers tableTransformers = new TableTransformers();
LoadFromClasspath resourceLoader = new LoadFromClasspath(embedderClass.getClassLoader());
return new MostUsefulConfiguration().useStoryLoader(resourceLoader).useStoryReporterBuilder(new StoryReporterBuilder().withCodeLocation(CodeLocations.codeLocationFromClass(embedderClass)).withDefaultFormats().withFormats(CONSOLE, TXT, HTML, XML).withCrossReference(new CrossReference())).useTableTransformers(tableTransformers).useParameterConverters(new ParameterConverters(resourceLoader, tableTransformers).addConverters(// use custom date pattern
new DateConverter(new SimpleDateFormat("yyyy-MM-dd")))).useStepPatternParser(new RegexPrefixCapturingPatternParser(// use '%' instead of '$' to identify parameters
"%")).useStepMonitor(new SilentStepMonitor());
}
use of org.jbehave.core.reporters.CrossReference in project jbehave-core by jbehave.
the class EmbedderBehaviour method shouldGenerateCrossReferenceWhenAvailable.
@Test
public void shouldGenerateCrossReferenceWhenAvailable() {
Embedder embedder = new Embedder();
embedder.useConfiguration(new MostUsefulConfiguration().useStoryReporterBuilder(new StoryReporterBuilder().withCrossReference(new CrossReference())));
// When
embedder.generateCrossReference();
// Then
assertXrefExists(embedder.configuration().storyReporterBuilder(), "json");
assertXrefExists(embedder.configuration().storyReporterBuilder(), "xml");
}
Aggregations