本文整理汇总了Java中org.jbehave.core.parsers.gherkin.GherkinStoryParser类的典型用法代码示例。如果您正苦于以下问题:Java GherkinStoryParser类的具体用法?Java GherkinStoryParser怎么用?Java GherkinStoryParser使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GherkinStoryParser类属于org.jbehave.core.parsers.gherkin包,在下文中一共展示了GherkinStoryParser类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testCreateShouldCreateConfiguration
import org.jbehave.core.parsers.gherkin.GherkinStoryParser; //导入依赖的package包/类
@Test
public void testCreateShouldCreateConfiguration() {
//GIVEN
JBehaveTestCase testCase = new JBehaveTestCase() {
@Override
protected String getStoryPath() {
return "something";
}
};
GherkinStoryParser gherkinStoryParser = new GherkinStoryParser();
StoryReporterBuilder storyReporterBuilder = new StoryReporterBuilder().withReporters(new JBehaveStoryReporter(testCase));
FailingUponPendingStep pendingStepStrategy = new FailingUponPendingStep();
given(storyParserFactory.createGherkinStoryParser()).willReturn(gherkinStoryParser);
given(pendingStepStrategyFactory.createFailingUponPendingStep()).willReturn(pendingStepStrategy);
given(storyReporterBuilderFactory.createForTestCase(testCase)).willReturn(storyReporterBuilder);
//WHEN
Configuration result = underTest.create(testCase);
//THEN
assertEquals(gherkinStoryParser, result.storyParser());
assertEquals(pendingStepStrategy, result.pendingStepStrategy());
assertEquals(storyReporterBuilder, result.storyReporterBuilder());
}
示例2: create
import org.jbehave.core.parsers.gherkin.GherkinStoryParser; //导入依赖的package包/类
/**
* Creates the {@link Configuration} for the Embedder.
* @param testCase the testCase that will be run by the Embedder.
* @return the configuration
*/
public Configuration create(final JBehaveTestCase testCase) {
Configuration configuration = new MostUsefulConfiguration();
GherkinStoryParser gherkinStoryParser = storyParserFactory.createGherkinStoryParser();
configuration.useStoryParser(gherkinStoryParser);
StoryReporterBuilder storyReporterBuilder = storyReporterBuilderFactory.createForTestCase(testCase);
configuration.useStoryReporterBuilder(storyReporterBuilder);
FailingUponPendingStep pendingStepStrategy = pendingStepStrategyFactory.createFailingUponPendingStep();
configuration.usePendingStepStrategy(pendingStepStrategy);
return configuration;
}
示例3: FeatureTests
import org.jbehave.core.parsers.gherkin.GherkinStoryParser; //导入依赖的package包/类
public FeatureTests() throws Exception {
configuration = new MostUsefulConfiguration()
.useStoryParser(new GherkinStoryParser())
.useStoryLoader(new LoadFromRelativeFile(new File(features).toURI().toURL()))
.useStoryReporterBuilder(new StoryReporterBuilder()
.withDefaultFormats().withFormats(Format.CONSOLE));
}
示例4: JBehaveRestStepsTest
import org.jbehave.core.parsers.gherkin.GherkinStoryParser; //导入依赖的package包/类
public JBehaveRestStepsTest() throws Exception {
configuration = new MostUsefulConfiguration()
.useStoryParser(new GherkinStoryParser())
.useStoryLoader(new LoadFromRelativeFile(new File(features).toURI().toURL()))
.useStoryReporterBuilder(new StoryReporterBuilder()
.withDefaultFormats().withFormats(Format.CONSOLE));
}
示例5: configuration
import org.jbehave.core.parsers.gherkin.GherkinStoryParser; //导入依赖的package包/类
@Override
public Configuration configuration() {
Class<? extends Embeddable> embeddableClass = this.getClass();
return new MostUsefulConfiguration()
.useStoryParser(new GherkinStoryParser())
.useStoryLoader(new LoadFromClasspath(embeddableClass))
.useStoryReporterBuilder(new StoryReporterBuilder()
.withCodeLocation(CodeLocations.codeLocationFromClass(embeddableClass))
.withDefaultFormats()
.withFormats(CONSOLE, HTML)
.withFailureTrace(true)
.withFailureTraceCompression(true));
}
示例6: createGherkinStoryParser
import org.jbehave.core.parsers.gherkin.GherkinStoryParser; //导入依赖的package包/类
/**
* Creates a new instance of {@link GherkinStoryParser}.
* @return a new instance of {@link GherkinStoryParser}
*/
public GherkinStoryParser createGherkinStoryParser() {
return new GherkinStoryParser();
}