org.jbehave.core.steps.ParameterConverters Java Examples

The following examples show how to use org.jbehave.core.steps.ParameterConverters. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Stories.java    From attic-rave with Apache License 2.0 6 votes vote down vote up
@Override
public Configuration configuration() {
    Class<? extends Embeddable> embeddableClass = this.getClass();
    // Start from default ParameterConverters instance
    ParameterConverters parameterConverters = new ParameterConverters();
    // factory to allow parameter conversion and loading from external resources (used by StoryParser too)
    ExamplesTableFactory examplesTableFactory = new ExamplesTableFactory(new LocalizedKeywords(), new LoadFromClasspath(embeddableClass), parameterConverters);
    // add custom converters
    parameterConverters.addConverters(
            new DateConverter(new SimpleDateFormat("yyyy-MM-dd")),
            new ParameterConverters.EnumConverter()
    );
    return new MostUsefulConfiguration()
            .useStoryLoader(new LoadFromClasspath(embeddableClass))
            .useStoryParser(new RegexStoryParser(examplesTableFactory))
            .useStoryReporterBuilder(new StoryReporterBuilder()
                    .withCodeLocation(CodeLocations.codeLocationFromClass(embeddableClass))
                    .withDefaultFormats()
                    .withFormats(CONSOLE, TXT, HTML, XML))
            .useParameterConverters(parameterConverters);
}
 
Example #2
Source File: JBConfiguratorImpl.java    From colibri-ui with Apache License 2.0 5 votes vote down vote up
@Override
public Configuration createConfig() {
    Configuration configuration = new Configuration() {
    };
    configuration.useStoryReporterBuilder(
            new StoryReporterBuilder()
                    .withDefaultFormats()
                    .withFormats(Format.CONSOLE)
                    .withReporters(allureReporter));
    configuration.useStoryControls(new StoryControls().doResetStateBeforeScenario(true));
    configuration.parameterConverters().addConverters(new ParameterConverters.EnumConverter());
    return configuration;
}
 
Example #3
Source File: JBConfiguratorImpl.java    From colibri-ui with Apache License 2.0 5 votes vote down vote up
@Override
public Configuration createConfig(ViewGenerator viewGenerator, Format... formats) {
    Configuration configuration = new MostUsefulConfiguration();
    configuration.useStoryReporterBuilder(
            new StoryReporterBuilder()
                    .withFormats(formats))
            .useViewGenerator(viewGenerator);
    configuration.useStoryControls(new StoryControls().doResetStateBeforeScenario(true));
    configuration.parameterConverters().addConverters(new ParameterConverters.EnumConverter());
    return configuration;
}
 
Example #4
Source File: FluentEnumListConverter.java    From vividus with Apache License 2.0 4 votes vote down vote up
@Inject
public FluentEnumListConverter(FluentTrimmedEnumConverter enumConverter)
{
    this(ParameterConverters.DEFAULT_COLLECTION_SEPARATOR, enumConverter);
}