本文整理汇总了Java中org.jbehave.core.reporters.Format类的典型用法代码示例。如果您正苦于以下问题:Java Format类的具体用法?Java Format怎么用?Java Format使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Format类属于org.jbehave.core.reporters包,在下文中一共展示了Format类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configuration
import org.jbehave.core.reporters.Format; //导入依赖的package包/类
@Override
public Configuration configuration() {
return new MostUsefulConfiguration()
// 找和java相同路徑的Story
.useStoryLoader(new LoadFromClasspath(this.getClass()))
// 設定Story行為檔佮JUnit設定檔的檔名對應
.useStoryPathResolver(new CasePreservingResolver())
// 有Step沒定義到視同Error
.usePendingStepStrategy(new FailingUponPendingStep())
// CONSOLE和TXT報表
.useStoryReporterBuilder(
new StoryReporterBuilder().withDefaultFormats().withFormats(
Format.CONSOLE,
Format.TXT
)
);
}
示例2: getConfiguration
import org.jbehave.core.reporters.Format; //导入依赖的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);
}
示例3: PortalStories
import org.jbehave.core.reporters.Format; //导入依赖的package包/类
protected PortalStories() {
CrossReference crossReference = new CrossReference().withJsonOnly().withOutputAfterEachStory(true)
.excludingStoriesWithNoExecutedScenarios(true);
ContextView contextView = new LocalFrameContextView().sized(640, 120);
SeleniumContext seleniumContext = new SeleniumContext();
SeleniumStepMonitor stepMonitor = new SeleniumStepMonitor(contextView, seleniumContext,
crossReference.getStepMonitor());
Format[] formats = new Format[]{new SeleniumContextOutput(seleniumContext), CONSOLE, WEB_DRIVER_HTML};
StoryReporterBuilder reporterBuilder = new StoryReporterBuilder()
.withCodeLocation(codeLocationFromClass(this.getClass())).withFailureTrace(true)
.withFailureTraceCompression(true).withDefaultFormats().withFormats(formats)
.withCrossReference(crossReference);
Configuration configuration = new SeleniumConfiguration().useSeleniumContext(seleniumContext)
.useFailureStrategy(new FailingUponPendingStep())
.useStoryControls(new StoryControls().doResetStateBeforeScenario(false)).useStepMonitor(stepMonitor)
.useStoryLoader(new LoadFromClasspath(this.getClass()))
.useStoryReporterBuilder(reporterBuilder);
useConfiguration(configuration);
ApplicationContext context = new SpringApplicationContextFactory("applicationContext-tests.xml").createApplicationContext();
useStepsFactory(new SpringStepsFactory(configuration, context));
}
示例4: InvoiceStories
import org.jbehave.core.reporters.Format; //导入依赖的package包/类
public InvoiceStories() {
CrossReference crossReference = new CrossReference().withJsonOnly().withOutputAfterEachStory(true)
.excludingStoriesWithNoExecutedScenarios(true);
ContextView contextView = new LocalFrameContextView().sized(640, 120);
SeleniumContext seleniumContext = new SeleniumContext();
SeleniumStepMonitor stepMonitor = new SeleniumStepMonitor(contextView, seleniumContext,
crossReference.getStepMonitor());
Format[] formats = new Format[] { new SeleniumContextOutput(seleniumContext), CONSOLE, WEB_DRIVER_HTML };
StoryReporterBuilder reporterBuilder = new StoryReporterBuilder()
.withCodeLocation(codeLocationFromClass(InvoiceStories.class)).withFailureTrace(true)
.withFailureTraceCompression(true).withDefaultFormats().withFormats(formats)
.withCrossReference(crossReference);
Configuration configuration = new SeleniumConfiguration().useSeleniumContext(seleniumContext)
.useFailureStrategy(new FailingUponPendingStep())
.useStoryControls(new StoryControls().doResetStateBeforeScenario(false)).useStepMonitor(stepMonitor)
.useStoryLoader(new LoadFromClasspath(InvoiceStories.class))
.useStoryReporterBuilder(reporterBuilder);
useConfiguration(configuration);
ApplicationContext context = new SpringApplicationContextFactory("invoice-steps.xml").createApplicationContext();
useStepsFactory(new SpringStepsFactory(configuration, context));
}
示例5: runStories
import org.jbehave.core.reporters.Format; //导入依赖的package包/类
private void runStories(String... storyPaths) {
StoryReporterBuilder storyReporterBuilder = new StoryReporterBuilder().withDefaultFormats()
.withCodeLocation(CodeLocations.codeLocationFromClass(ReportTransformBehaviour.class))
.withFormats(Format.XML);
Configuration configuration = new MostUsefulConfiguration()
.useStoryLoader(new LoadFromClasspath(this.getClass())).useStoryReporterBuilder(storyReporterBuilder)
.useFailureStrategy(new SilentlyAbsorbingFailure())
.useStepCollector(new MarkUnmatchedStepsAsPending(new StepFinder(new ByLevenshteinDistance())));
Embedder embedder = new Embedder();
embedder.useEmbedderControls(new EmbedderControls().doGenerateViewAfterStories(false));
embedder.useConfiguration(configuration);
embedder.useCandidateSteps(new InstanceStepsFactory(configuration, new MySteps()).createCandidateSteps());
embedder.useMetaFilters(asList("-skip true"));
try {
embedder.runStoriesAsPaths(asList(storyPaths));
} catch (Exception e) {
e.printStackTrace();
}
}
示例6: createConfig
import org.jbehave.core.reporters.Format; //导入依赖的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;
}
示例7: configuration
import org.jbehave.core.reporters.Format; //导入依赖的package包/类
@Override
public Configuration configuration() {
return new MostUsefulConfiguration()
.useStoryLoader(new LoadFromClasspath(this.getClass()))
.useStoryReporterBuilder(new StoryReporterBuilder()
.withDefaultFormats()
.withFormats(Format.CONSOLE, Format.TXT));
}
示例8: configuration
import org.jbehave.core.reporters.Format; //导入依赖的package包/类
@Override
public Configuration configuration() {
return new MostUsefulConfiguration()
.useStoryReporterBuilder(
new StoryReporterBuilder()
.withFormats(Format.STATS)
);
}
示例9: configuration
import org.jbehave.core.reporters.Format; //导入依赖的package包/类
@Override
public Configuration configuration() {
return new MostUsefulConfiguration().usePendingStepStrategy(new FailingUponPendingStep()).useStoryReporterBuilder(
new StoryReporterBuilder()
.withDefaultFormats()
.withPathResolver(new ResolveToPackagedName())
.withFormats(Format.HTML)
.withFailureTrace(true)
.withFailureTraceCompression(true));
}
示例10: configuration
import org.jbehave.core.reporters.Format; //导入依赖的package包/类
@Override
public final Configuration configuration() {
return new MostUsefulConfiguration()
.useStoryLoader(new LoadFromClasspath(this.getClass()))
.usePendingStepStrategy(new FailingUponPendingStep())
.useStoryReporterBuilder(new StoryReporterBuilder().withDefaultFormats()
.withFormats(Format.CONSOLE));
}
示例11: configuration
import org.jbehave.core.reporters.Format; //导入依赖的package包/类
@Override
public Configuration configuration() {
return new MostUsefulConfiguration()
.useStoryLoader(
new LoadFromClasspath(this.getClass().getClassLoader()))
.useStoryReporterBuilder(
new StoryReporterBuilder()
.withDefaultFormats()
.withFormats(Format.HTML, Format.CONSOLE)
.withRelativeDirectory("jbehave-report")
);
}
示例12: configuration
import org.jbehave.core.reporters.Format; //导入依赖的package包/类
@Override
public Configuration configuration() {
return new MostUsefulConfiguration()
.useStoryLoader(new LoadFromClasspath(this.getClass()))
.useStoryReporterBuilder(new StoryReporterBuilder()
.withCodeLocation(codeLocationFromClass(this.getClass()))
.withFormats(Format.CONSOLE));
}
示例13: configuration
import org.jbehave.core.reporters.Format; //导入依赖的package包/类
@Override
public Configuration configuration() {
return new MostUsefulConfiguration()
.usePendingStepStrategy(new FailingUponPendingStep())
.useStoryControls(new StoryControls().doSkipBeforeAndAfterScenarioStepsIfGivenStory(false))
.useStoryLoader(new LoadFromClasspath(getClass()))
.useStoryReporterBuilder(new StoryReporterBuilder().withDefaultFormats().withFormats(Format.CONSOLE, Format.TXT));
}
示例14: configuration
import org.jbehave.core.reporters.Format; //导入依赖的package包/类
@Override
public Configuration configuration() {
LocalizedKeywords keywords = new LocalizedKeywords(new Locale("de"));
return new MostUsefulConfiguration()
.useKeywords(keywords)
.useStepCollector(new MarkUnmatchedStepsAsPending(keywords))
.useStoryParser(new RegexStoryParser(keywords))
.useStoryLoader(new LoadFromClasspath(this.getClass()))
.useFailureStrategy(new RethrowingFailure())
.useStoryReporterBuilder(
new StoryReporterBuilder().withKeywords(keywords)
.withFormats(Format.HTML, Format.ANSI_CONSOLE)
.withFailureTrace(true));
}
示例15: configuration
import org.jbehave.core.reporters.Format; //导入依赖的package包/类
@Override
public final Configuration configuration() {
return new MostUsefulConfiguration()
// where to find the stories
.useStoryLoader(new LoadFromClasspath(this.getClass()))
// Fails if Steps are not implemented
.usePendingStepStrategy(new FailingUponPendingStep())
// CONSOLE and HTML reporting
.useStoryReporterBuilder(new StoryReporterBuilder().withDefaultFormats()
.withFormats(Format.CONSOLE, Format.HTML));
}