use of org.jbehave.core.configuration.Configuration in project jbehave-core by jbehave.
the class WeldAnnotationBuilderBehaviour method shouldCreateOnlyOneContainerForMultipleBuildInvocations.
@Test
public void shouldCreateOnlyOneContainerForMultipleBuildInvocations() {
AnnotationBuilder builderAnnotated = createBuilder(AnnotatedUsingWeld.class);
Configuration configuration = builderAnnotated.buildConfiguration();
assertThat(builderAnnotated.buildConfiguration(), sameInstance(configuration));
}
use of org.jbehave.core.configuration.Configuration 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);
}
}
use of org.jbehave.core.configuration.Configuration in project jbehave-core by jbehave.
the class PicoAnnotationBuilderBehaviour method shouldBuildCandidateStepsFromAnnotationsUsingStepsAndPico.
@Test
public void shouldBuildCandidateStepsFromAnnotationsUsingStepsAndPico() {
PicoAnnotationBuilder builderAnnotated = new PicoAnnotationBuilder(AnnotatedUsingStepsAndPico.class);
Configuration configuration = builderAnnotated.buildConfiguration();
assertThatStepsInstancesAre(builderAnnotated.buildCandidateSteps(configuration), FooSteps.class);
}
use of org.jbehave.core.configuration.Configuration in project jbehave-core by jbehave.
the class PicoAnnotationBuilderBehaviour method shouldBuildConfigurationFromAnnotations.
@Test
public void shouldBuildConfigurationFromAnnotations() {
PicoAnnotationBuilder builder = new PicoAnnotationBuilder(AnnotatedUsingPico.class);
Configuration configuration = builder.buildConfiguration();
assertThat(configuration.storyControls().dryRun(), is(true));
assertThat(configuration.storyControls().skipScenariosAfterFailure(), is(true));
assertThat(configuration.failureStrategy(), instanceOf(SilentlyAbsorbingFailure.class));
assertThat(configuration.storyLoader(), instanceOf(LoadFromURL.class));
assertThat(configuration.stepPatternParser(), instanceOf(RegexPrefixCapturingPatternParser.class));
assertThat(((RegexPrefixCapturingPatternParser) configuration.stepPatternParser()).getPrefix(), equalTo("MyPrefix"));
assertThatDateIsConvertedWithFormat(configuration.parameterConverters(), new SimpleDateFormat("yyyy-MM-dd"));
assertThat(configuration.storyReporterBuilder().formats(), hasItems(CONSOLE, HTML, TXT, XML, STATS));
Keywords keywords = configuration.storyReporterBuilder().keywords();
assertThat(keywords, instanceOf(LocalizedKeywords.class));
assertThat(((LocalizedKeywords) keywords).getLocale(), equalTo(Locale.ITALIAN));
assertThat(configuration.storyReporterBuilder().outputDirectory().getName(), equalTo("my-output-directory"));
assertThat(configuration.storyReporterBuilder().viewResources().getProperty("index"), equalTo("my-reports-index.ftl"));
assertThat(configuration.storyReporterBuilder().viewResources().getProperty("decorateNonHtml"), equalTo("true"));
assertThat(configuration.storyReporterBuilder().reportFailureTrace(), is(true));
}
use of org.jbehave.core.configuration.Configuration in project jbehave-core by jbehave.
the class WeldAnnotationBuilderBehaviour method shouldBuildConfigurationFromAnnotations.
@Test
public void shouldBuildConfigurationFromAnnotations() {
AnnotationBuilder builder = createBuilder(AnnotatedUsingWeld.class);
Configuration configuration = builder.buildConfiguration();
assertThat(configuration.storyControls().dryRun(), is(true));
assertThat(configuration.storyControls().skipScenariosAfterFailure(), is(true));
assertThat(configuration.failureStrategy(), instanceOf(SilentlyAbsorbingFailure.class));
assertThat(configuration.storyLoader(), instanceOf(LoadFromURL.class));
assertThat(configuration.stepPatternParser(), instanceOf(RegexPrefixCapturingPatternParser.class));
assertThat(((RegexPrefixCapturingPatternParser) configuration.stepPatternParser()).getPrefix(), equalTo("MyPrefix"));
assertThatCustomObjectIsConverted(configuration.parameterConverters());
assertThatDateIsConvertedWithFormat(configuration.parameterConverters(), new SimpleDateFormat("yyyy-MM-dd"));
assertThat(configuration.storyReporterBuilder().formats(), hasItems(CONSOLE, HTML, TXT, XML, STATS));
Keywords keywords = configuration.storyReporterBuilder().keywords();
assertThat(keywords, instanceOf(LocalizedKeywords.class));
assertThat(((LocalizedKeywords) keywords).getLocale(), equalTo(Locale.ITALIAN));
assertThat(configuration.storyReporterBuilder().outputDirectory().getName(), equalTo("my-output-directory"));
assertThat(configuration.storyReporterBuilder().viewResources().getProperty("index"), equalTo("my-reports-index.ftl"));
assertThat(configuration.storyReporterBuilder().viewResources().getProperty("decorateNonHtml"), equalTo("true"));
assertThat(configuration.storyReporterBuilder().reportFailureTrace(), is(true));
}
Aggregations