Search in sources :

Example 11 with ParameterConverters

use of org.jbehave.core.steps.ParameterConverters in project jbehave-core by jbehave.

the class ConfigurationProducer method getConfiguration.

@Produces
@WeldConfiguration
Configuration getConfiguration() {
    Properties viewResources = new Properties();
    viewResources.setProperty("index", "my-reports-index.ftl");
    viewResources.setProperty("decorateNonHtml", "true");
    TableTransformers tableTransformers = new TableTransformers();
    LoadFromURL resourceLoader = new LoadFromURL();
    return new MostUsefulConfiguration().useStoryControls(new StoryControls().doDryRun(true).doSkipScenariosAfterFailure(true)).useFailureStrategy(new SilentlyAbsorbingFailure()).useStoryLoader(resourceLoader).useStepPatternParser(new RegexPrefixCapturingPatternParser("MyPrefix")).useStoryReporterBuilder(new StoryReporterBuilder().withDefaultFormats().withFormats(CONSOLE, HTML, TXT, XML).withKeywords(new LocalizedKeywords(Locale.ITALIAN)).withRelativeDirectory("my-output-directory").withViewResources(viewResources).withFailureTrace(true)).useParameterConverters(new ParameterConverters(resourceLoader, tableTransformers).addConverters(new CustomConverter(), new MyDateConverter())).useTableTransformers(tableTransformers);
}
Also used : SilentlyAbsorbingFailure(org.jbehave.core.failures.SilentlyAbsorbingFailure) RegexPrefixCapturingPatternParser(org.jbehave.core.parsers.RegexPrefixCapturingPatternParser) StoryReporterBuilder(org.jbehave.core.reporters.StoryReporterBuilder) LoadFromURL(org.jbehave.core.io.LoadFromURL) MostUsefulConfiguration(org.jbehave.core.configuration.MostUsefulConfiguration) ParameterConverters(org.jbehave.core.steps.ParameterConverters) LocalizedKeywords(org.jbehave.core.i18n.LocalizedKeywords) StoryControls(org.jbehave.core.embedder.StoryControls) Properties(java.util.Properties) TableTransformers(org.jbehave.core.model.TableTransformers) Produces(javax.enterprise.inject.Produces) WeldConfiguration(org.jbehave.core.annotations.weld.WeldConfiguration)

Aggregations

ParameterConverters (org.jbehave.core.steps.ParameterConverters)11 LoadFromClasspath (org.jbehave.core.io.LoadFromClasspath)9 TableTransformers (org.jbehave.core.model.TableTransformers)8 MostUsefulConfiguration (org.jbehave.core.configuration.MostUsefulConfiguration)7 StoryReporterBuilder (org.jbehave.core.reporters.StoryReporterBuilder)7 ParameterControls (org.jbehave.core.steps.ParameterControls)7 SimpleDateFormat (java.text.SimpleDateFormat)5 Properties (java.util.Properties)5 LocalizedKeywords (org.jbehave.core.i18n.LocalizedKeywords)5 DateConverter (org.jbehave.core.steps.ParameterConverters.DateConverter)5 RegexStoryParser (org.jbehave.core.parsers.RegexStoryParser)4 StoryControls (org.jbehave.core.embedder.StoryControls)3 ExamplesTableFactory (org.jbehave.core.model.ExamplesTableFactory)3 ExamplesTableConverter (org.jbehave.core.steps.ParameterConverters.ExamplesTableConverter)3 Produces (javax.enterprise.inject.Produces)2 WeldConfiguration (org.jbehave.core.annotations.weld.WeldConfiguration)2 RegexPrefixCapturingPatternParser (org.jbehave.core.parsers.RegexPrefixCapturingPatternParser)2 Test (org.junit.Test)2 URL (java.net.URL)1 Keywords (org.jbehave.core.configuration.Keywords)1