本文整理汇总了Java中org.jbehave.core.steps.ParameterConverters类的典型用法代码示例。如果您正苦于以下问题:Java ParameterConverters类的具体用法?Java ParameterConverters怎么用?Java ParameterConverters使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ParameterConverters类属于org.jbehave.core.steps包,在下文中一共展示了ParameterConverters类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getConfiguration
import org.jbehave.core.steps.ParameterConverters; //导入依赖的package包/类
@Produces
@Singleton
@ConfigurationAlternative
@WeldConfiguration
public Configuration getConfiguration()
{
LOG.info("ConfigurationProducer.getConfiguration()");
Keywords keywords = new LocalizedKeywords();
ParameterConverters converters = new ParameterConverters().addConverters(new DateConverter(new SimpleDateFormat("yyyy-MM-dd")), new StoryParameterEnumConverter());
return new MostUsefulConfiguration().useStoryControls(new StoryControls().doDryRun(runConfig.doDryRun()).doSkipScenariosAfterFailure(false))
.useStepPatternParser(new RegexPrefixCapturingPatternParser()).useStoryLoader(new LoadFromClasspath(this.getClass().getClassLoader()))
.useKeywords(keywords).useStepCollector(new MarkUnmatchedStepsAsPending(keywords)).useStoryParser(new RegexStoryParser(keywords, new ExamplesTableFactory(keywords, new LoadFromClasspath(this.getClass()), converters))).useDefaultStoryReporter(new ConsoleOutput(keywords))
.useStoryReporterBuilder(new StoryReporterBuilder().withFormats(Format.CONSOLE, Format.TXT, Format.STATS, WebDriverHtmlOutputWithImg.WEB_DRIVER_HTML_WITH_IMG).withFailureTrace(true).withReporters(new LoggingStoryReporter()).withKeywords(keywords)).useParameterConverters(converters);
}
开发者ID:partnet,项目名称:seauto,代码行数:21,代码来源:DefaultConfigurationProducer.java
示例2: configuration
import org.jbehave.core.steps.ParameterConverters; //导入依赖的package包/类
@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);
}
开发者ID:apache,项目名称:rave,代码行数:22,代码来源:Stories.java
示例3: configuration
import org.jbehave.core.steps.ParameterConverters; //导入依赖的package包/类
@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 ExamplesTableConverter(examplesTableFactory));
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);
}
开发者ID:wemanity,项目名称:Acceptance-Tests-with-JBehave,代码行数:20,代码来源:MyStories.java
示例4: configuration
import org.jbehave.core.steps.ParameterConverters; //导入依赖的package包/类
@Override
public Configuration configuration() {
Class<? extends Embeddable> embeddableClass = this.getClass();
Properties viewResources = new Properties();
viewResources.put("decorateNonHtml", "true");
return new MostUsefulConfiguration()
.useParanamer(paranamer)
.useStoryLoader(new LoadFromClasspath(embeddableClass))
.useStoryPathResolver(new UnderscoredCamelCaseResolver().removeFromClassName("Story"))
.useStoryReporterBuilder(new StoryReporterBuilder()
.withCodeLocation(CodeLocations.codeLocationFromClass(embeddableClass))
.withDefaultFormats()
.withPathResolver(new FilePrintStreamFactory.ResolveToPackagedName())
.withViewResources(viewResources)
.withFormats(CONSOLE, TXT, HTML, XML))
.useParameterConverters(new ParameterConverters()
.addConverters(new ParameterConverters.NumberConverter(), new DateConverter(new SimpleDateFormat("yyyy-MM-dd")))) // use custom date pattern
.useStepPatternParser(new RegexPrefixCapturingPatternParser(
"$")) // use '%' instead of '$' to identify parameters
.useStepMonitor(new SilentStepMonitor());
}
开发者ID:yujunliang,项目名称:seleniumcapsules,代码行数:22,代码来源:AllStoryRunner.java
示例5: configuration
import org.jbehave.core.steps.ParameterConverters; //导入依赖的package包/类
@Override
public Configuration configuration() {
Class<? extends TraderEmbedder> embedderClass = this.getClass();
return new MostUsefulConfiguration()
.useStoryLoader(new LoadFromClasspath(embedderClass.getClassLoader()))
.useStoryReporterBuilder(new StoryReporterBuilder()
.withCodeLocation(CodeLocations.codeLocationFromClass(embedderClass))
.withDefaultFormats()
.withFormats(CONSOLE, TXT, HTML, XML)
.withCrossReference(new CrossReference()))
.useParameterConverters(new ParameterConverters()
.addConverters(new DateConverter(new SimpleDateFormat("yyyy-MM-dd")))) // use custom date pattern
.useStepPatternParser(new RegexPrefixCapturingPatternParser(
"%")) // use '%' instead of '$' to identify parameters
.useStepMonitor(new SilentStepMonitor());
}
开发者ID:vactowb,项目名称:jbehave-core,代码行数:17,代码来源:TraderEmbedder.java
示例6: configuration
import org.jbehave.core.steps.ParameterConverters; //导入依赖的package包/类
@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 ExamplesTableConverter(examplesTableFactory));
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);
}
开发者ID:vactowb,项目名称:jbehave-core,代码行数:20,代码来源:MyStories.java
示例7: shouldConvertParameterValuesOfTableRow
import org.jbehave.core.steps.ParameterConverters; //导入依赖的package包/类
@Test
public void shouldConvertParameterValuesOfTableRow() throws Exception {
// Given
ParameterConverters parameterConverters = new ParameterConverters();
parameterConverters.addConverters(new MethodReturningConverter(methodFor("convertDate"), this));
ExamplesTableFactory factory = new ExamplesTableFactory(parameterConverters);
// When
String tableAsString = "|one|two|\n|11|22|\n|1/1/2010|2/2/2010|";
ExamplesTable examplesTable = factory.createExamplesTable(tableAsString);
// Then
Parameters integers = examplesTable.getRowAsParameters(0);
assertThat(integers.valueAs("one", Integer.class), equalTo(11));
assertThat(integers.valueAs("two", Integer.class), equalTo(22));
Parameters dates = examplesTable.getRowAsParameters(1);
assertThat(dates.valueAs("one", Date.class), equalTo(convertDate("1/1/2010")));
assertThat(dates.valueAs("two", Date.class), equalTo(convertDate("2/2/2010")));
}
开发者ID:vactowb,项目名称:jbehave-core,代码行数:20,代码来源:ExamplesTableBehaviour.java
示例8: shouldAllowBuildingOfTableFromContent
import org.jbehave.core.steps.ParameterConverters; //导入依赖的package包/类
@Test
public void shouldAllowBuildingOfTableFromContent() throws Exception {
// Given
ParameterConverters parameterConverters = new ParameterConverters();
ExamplesTableFactory factory = new ExamplesTableFactory(parameterConverters);
// When
String tableAsString = "|one|two|\n|11|12|\n|21|22|";
ExamplesTable originalTable = factory.createExamplesTable(tableAsString);
List<Map<String, String>> content = originalTable.getRows();
content.get(0).put("three", "13");
content.get(1).put("three", "23");
ExamplesTable updatedTable = originalTable.withRows(content);
// Then
assertThat(updatedTable.asString(), equalTo("|one|two|three|\n|11|12|13|\n|21|22|23|\n"));
}
开发者ID:vactowb,项目名称:jbehave-core,代码行数:18,代码来源:ExamplesTableBehaviour.java
示例9: shouldAllowOutputToPrintStream
import org.jbehave.core.steps.ParameterConverters; //导入依赖的package包/类
@Test
public void shouldAllowOutputToPrintStream() throws Exception {
// Given
ParameterConverters parameterConverters = new ParameterConverters();
ExamplesTableFactory factory = new ExamplesTableFactory(parameterConverters);
// When
String tableAsString = "|one|two|\n|11|12|\n|21|22|\n";
ExamplesTable table = factory.createExamplesTable(tableAsString);
OutputStream out = new ByteArrayOutputStream();
PrintStream output = new PrintStream(out);
table.outputTo(output);
// Then
assertThat(out.toString(), equalTo(tableAsString));
}
开发者ID:vactowb,项目名称:jbehave-core,代码行数:17,代码来源:ExamplesTableBehaviour.java
示例10: shouldNotAllowModificationOfConfigurationElements
import org.jbehave.core.steps.ParameterConverters; //导入依赖的package包/类
@Test
public void shouldNotAllowModificationOfConfigurationElements() throws NoSuchMethodException,
IllegalAccessException {
Configuration delegate = new MostUsefulConfiguration();
Configuration unmodifiable = new UnmodifiableConfiguration(delegate);
assertThatNotAllowed(unmodifiable, "useKeywords", Keywords.class);
assertThatNotAllowed(unmodifiable, "doDryRun", Boolean.class);
assertThatNotAllowed(unmodifiable, "useStoryControls", StoryControls.class);
assertThatNotAllowed(unmodifiable, "useStoryLoader", StoryLoader.class);
assertThatNotAllowed(unmodifiable, "useStoryParser", StoryParser.class);
assertThatNotAllowed(unmodifiable, "useDefaultStoryReporter", StoryReporter.class);
assertThatNotAllowed(unmodifiable, "useStoryReporterBuilder", StoryReporterBuilder.class);
assertThatNotAllowed(unmodifiable, "useStoryPathResolver", StoryPathResolver.class);
assertThatNotAllowed(unmodifiable, "useFailureStrategy", FailureStrategy.class);
assertThatNotAllowed(unmodifiable, "usePendingStepStrategy", PendingStepStrategy.class);
assertThatNotAllowed(unmodifiable, "useParanamer", Paranamer.class);
assertThatNotAllowed(unmodifiable, "useParameterConverters", ParameterConverters.class);
assertThatNotAllowed(unmodifiable, "useParameterControls", ParameterControls.class);
assertThatNotAllowed(unmodifiable, "useStepCollector", StepCollector.class);
assertThatNotAllowed(unmodifiable, "useStepMonitor", StepMonitor.class);
assertThatNotAllowed(unmodifiable, "useStepPatternParser", StepPatternParser.class);
assertThatNotAllowed(unmodifiable, "useViewGenerator", ViewGenerator.class);
assertThatNotAllowed(unmodifiable, "useStoryPathResolver", StoryPathResolver.class);
}
开发者ID:vactowb,项目名称:jbehave-core,代码行数:25,代码来源:UnmodifiableConfigurationBehaviour.java
示例11: getConfiguration
import org.jbehave.core.steps.ParameterConverters; //导入依赖的package包/类
@Produces @WeldConfiguration
Configuration getConfiguration() {
Properties viewResources = new Properties();
viewResources.setProperty("index", "my-reports-index.ftl");
viewResources.setProperty("decorateNonHtml", "true");
return new MostUsefulConfiguration()
.useStoryControls(new StoryControls()
.doDryRun(true)
.doSkipScenariosAfterFailure(true))
.useFailureStrategy(new SilentlyAbsorbingFailure())
.useStoryLoader(new LoadFromURL())
.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()
.addConverters(new CustomConverter(),new MyDateConverter()));
}
开发者ID:vactowb,项目名称:jbehave-core,代码行数:26,代码来源:ConfigurationProducer.java
示例12: configuration
import org.jbehave.core.steps.ParameterConverters; //导入依赖的package包/类
@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 coverters
parameterConverters.addConverters(new DateConverter(new SimpleDateFormat("yyyy-MM-dd")),
new ExamplesTableConverter(examplesTableFactory));
// parameterConverters.addConverters(new MyConverter());
// parameterConverters.addConverters(new StudentConverter(new ExamplesTableFactory()));
CrossReference xref = new CrossReference();
return new MostUsefulConfiguration()
.useStoryLoader(new LoadFromClasspath(embeddableClass))
.useStoryParser(new RegexStoryParser(examplesTableFactory))
.useStoryReporterBuilder(new StoryReporterBuilder()
.withCodeLocation(CodeLocations.codeLocationFromClass(embeddableClass))
.withDefaultFormats()
.withCrossReference(xref )
.withFormats(CONSOLE, TXT, WebDriverHtmlOutput.WEB_DRIVER_HTML, XML))
.useParameterConverters(parameterConverters);
}
开发者ID:saikrishna321,项目名称:JBehave-Selendroid-Android-Automation,代码行数:25,代码来源:MyStoriesMaps.java
示例13: createConfig
import org.jbehave.core.steps.ParameterConverters; //导入依赖的package包/类
@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;
}
开发者ID:alfa-laboratory,项目名称:colibri-ui,代码行数:14,代码来源:JBConfiguratorImpl.java
示例14: parameterConverters
import org.jbehave.core.steps.ParameterConverters; //导入依赖的package包/类
@Override
protected ParameterConverters parameterConverters(AnnotationFinder annotationFinder) {
ParameterConverters converters = super.parameterConverters(annotationFinder);
if (context != null) {
return converters.addConverters(getBeansOfType(context, ParameterConverter.class));
}
return converters;
}
开发者ID:vactowb,项目名称:jbehave-core,代码行数:9,代码来源:SpringAnnotationBuilder.java
示例15: assertThatDateIsConvertedWithFormat
import org.jbehave.core.steps.ParameterConverters; //导入依赖的package包/类
private void assertThatDateIsConvertedWithFormat(ParameterConverters parameterConverters, DateFormat dateFormat) {
String date = "2010-10-10";
try {
assertThat((Date) parameterConverters.convert(date, Date.class), equalTo(dateFormat.parse(date)));
} catch (ParseException e) {
Assert.fail();
}
}
开发者ID:vactowb,项目名称:jbehave-core,代码行数:9,代码来源:SpringAnnotationBuilderBehaviour.java
示例16: configuration
import org.jbehave.core.steps.ParameterConverters; //导入依赖的package包/类
@Override
public Configuration configuration() {
Class<? extends Embeddable> embeddableClass = this.getClass();
Properties viewResources = new Properties();
viewResources.put("decorateNonHtml", "true");
viewResources.put("reports", "ftl/jbehave-reports-with-totals.ftl");
// 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, new TableTransformers());
// add custom converters
parameterConverters.addConverters(new DateConverter(new SimpleDateFormat("yyyy-MM-dd")),
new ExamplesTableConverter(examplesTableFactory));
return new MostUsefulConfiguration()
.useStoryLoader(new LoadFromClasspath(embeddableClass))
.useStoryParser(new RegexStoryParser(examplesTableFactory))
.useStoryReporterBuilder(new StoryReporterBuilder()
.withCodeLocation(CodeLocations.codeLocationFromClass(embeddableClass))
.withDefaultFormats()
.withViewResources(viewResources)
.withFormats(CONSOLE, TXT, HTML_TEMPLATE, XML_TEMPLATE)
.withFailureTrace(true)
.withFailureTraceCompression(true)
.withCrossReference(xref))
.useParameterConverters(parameterConverters)
// use '%' instead of '$' to identify parameters
.useStepPatternParser(new RegexPrefixCapturingPatternParser(
"%"))
.useStepMonitor(xref.getStepMonitor());
}
开发者ID:vactowb,项目名称:jbehave-core,代码行数:31,代码来源:TraderStories.java
示例17: configuration
import org.jbehave.core.steps.ParameterConverters; //导入依赖的package包/类
@Override
public Configuration configuration() {
Class<? extends Embeddable> embeddableClass = this.getClass();
Properties viewResources = new Properties();
viewResources.put("decorateNonHtml", "true");
// 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, new TableTransformers());
// add custom converters
parameterConverters.addConverters(new DateConverter(new SimpleDateFormat("yyyy-MM-dd")),
new ExamplesTableConverter(examplesTableFactory));
return new MostUsefulConfiguration()
.useStoryControls(new StoryControls().doDryRun(false).doSkipScenariosAfterFailure(false))
.useStoryLoader(new LoadFromClasspath(embeddableClass))
.useStoryParser(new RegexStoryParser(examplesTableFactory))
.useStoryPathResolver(new UnderscoredCamelCaseResolver())
.useStoryReporterBuilder(
new StoryReporterBuilder()
.withCodeLocation(CodeLocations.codeLocationFromClass(embeddableClass))
.withDefaultFormats().withPathResolver(new ResolveToPackagedName())
.withViewResources(viewResources).withFormats(CONSOLE, TXT, HTML, XML)
.withFailureTrace(true).withFailureTraceCompression(true).withCrossReference(xref))
.useParameterConverters(parameterConverters)
// use '%' instead of '$' to identify parameters
.useStepPatternParser(new RegexPrefixCapturingPatternParser("%")).useStepMonitor(xref.getStepMonitor());
}
开发者ID:vactowb,项目名称:jbehave-core,代码行数:31,代码来源:TraderStory.java
示例18: getConfiguration
import org.jbehave.core.steps.ParameterConverters; //导入依赖的package包/类
@Produces @WeldConfiguration
public Configuration getConfiguration() {
return new MostUsefulConfiguration()
.useStoryControls(new StoryControls()
.doDryRun(false)
.doSkipScenariosAfterFailure(false))
.useStepPatternParser(new RegexPrefixCapturingPatternParser("%"))
.useStoryLoader(new LoadFromClasspath(getClass().getClassLoader()))
.useStoryReporterBuilder(new StoryReporterBuilder()
.withDefaultFormats()
.withFormats(CONSOLE, HTML, TXT, XML))
.useParameterConverters(new ParameterConverters()
.addConverters(new DateConverter(new SimpleDateFormat("yyyy-MM-dd"))));
}
开发者ID:vactowb,项目名称:jbehave-core,代码行数:15,代码来源:ConfigurationProducer.java
示例19: parameterConverters
import org.jbehave.core.steps.ParameterConverters; //导入依赖的package包/类
@Override
protected ParameterConverters parameterConverters(AnnotationFinder annotationFinder) {
ParameterConverters converters = super.parameterConverters(annotationFinder);
if (injector != null) {
return converters.addConverters(findConverters(injector));
}
return converters;
}
开发者ID:vactowb,项目名称:jbehave-core,代码行数:9,代码来源:GuiceAnnotationBuilder.java
示例20: parameterConverters
import org.jbehave.core.steps.ParameterConverters; //导入依赖的package包/类
@Override
protected ParameterConverters parameterConverters(AnnotationFinder annotationFinder) {
ParameterConverters converters = super.parameterConverters(annotationFinder);
if (container != null) {
return converters.addConverters(container.getComponents(ParameterConverter.class));
}
return converters;
}
开发者ID:vactowb,项目名称:jbehave-core,代码行数:9,代码来源:PicoAnnotationBuilder.java
注:本文中的org.jbehave.core.steps.ParameterConverters类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论