use of org.jbehave.core.model.TableTransformers in project jbehave-core by jbehave.
the class LocalizedStories method configuration.
@Override
public Configuration configuration() {
ClassLoader classLoader = this.getClass().getClassLoader();
URL codeLocation = CodeLocations.codeLocationFromClass(this.getClass());
Keywords keywords = new LocalizedKeywords(locale());
Properties properties = new Properties();
properties.setProperty("reports", "ftl/jbehave-reports.ftl");
properties.setProperty("encoding", "UTF-8");
LoadFromClasspath resourceLoader = new LoadFromClasspath(classLoader);
TableTransformers tableTransformers = new TableTransformers();
ParameterControls parameterControls = new ParameterControls();
ParameterConverters parameterConverters = new ParameterConverters(resourceLoader, parameterControls, tableTransformers, true).addConverters(customConverters(keywords, resourceLoader, tableTransformers));
return new MostUsefulConfiguration().useKeywords(keywords).useStepCollector(new MarkUnmatchedStepsAsPending(keywords)).useStoryParser(new RegexStoryParser(keywords, resourceLoader, tableTransformers)).useStoryLoader(resourceLoader).useStoryReporterBuilder(new StoryReporterBuilder().withCodeLocation(codeLocation).withPathResolver(new ResolveToSimpleName()).withDefaultFormats().withFormats(CONSOLE, TXT, HTML, XML).withFailureTrace(false).withViewResources(properties).withKeywords(keywords)).useParameterConverters(parameterConverters).useParameterControls(parameterControls).useTableTransformers(tableTransformers);
}
use of org.jbehave.core.model.TableTransformers 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.model.TableTransformers 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.model.TableTransformers in project jbehave-core by jbehave.
the class ConfigurationProducer method getConfiguration.
@Produces
@WeldConfiguration
public Configuration getConfiguration() {
LoadFromClasspath resourceLoader = new LoadFromClasspath(getClass().getClassLoader());
TableTransformers tableTransformers = new TableTransformers();
return new MostUsefulConfiguration().useStoryControls(new StoryControls().doDryRun(false).doSkipScenariosAfterFailure(false)).useStoryLoader(resourceLoader).useStoryReporterBuilder(new StoryReporterBuilder().withDefaultFormats().withFormats(CONSOLE, HTML, TXT, XML)).useParameterConverters(new ParameterConverters(resourceLoader, tableTransformers).addConverters(new DateConverter(new SimpleDateFormat("yyyy-MM-dd")))).useTableTransformers(tableTransformers);
}
use of org.jbehave.core.model.TableTransformers in project serenity-jbehave by serenity-bdd.
the class SerenityJBehave method defaultConfiguration.
// private static final CrossReference xref = new CrossReference();
/**
* Returns a default JBehave configuration object suitable for ThucydidesWebdriverIntegration tests.
*/
public static Configuration defaultConfiguration(net.thucydides.core.webdriver.Configuration systemConfiguration, List<Format> formats, Embeddable embeddable) {
Class<? extends Embeddable> embeddableClass = embeddable.getClass();
Properties viewResources = new Properties();
viewResources.put("decorateNonHtml", "true");
TableTransformers tableTransformers = new TableTransformers();
UTF8StoryLoader utf8StoryLoader = new UTF8StoryLoader();
return new ParanamerConfiguration().useTableTransformers(tableTransformers).useParameterConverters(new ParameterConverters(utf8StoryLoader, tableTransformers).addConverters(new ParameterConverters.DateConverter(), new DateListConverter(), new DateTimeConverter(), new DateTimeListConverter(), new YearMonthConverter(), new YearMonthListConverter(), new TimeConverter(), new TimeListConverter(), new ParameterConverters.EnumConverter(), new ParameterConverters.EnumListConverter())).useStoryReporterBuilder(new StoryReporterBuilder().withDefaultFormats().withFormats(formats.toArray(new Format[0])).withCodeLocation(CodeLocations.codeLocationFromClass(embeddableClass)).withViewResources(viewResources).withPathResolver(new FilePrintStreamFactory.ResolveToPackagedName()).withFailureTrace(true).withFailureTraceCompression(true).withReporters(new SerenityReporter(systemConfiguration))).useStoryLoader(utf8StoryLoader).useFailureStrategy(new IgnoreAssumptionViolations());
}
Aggregations