本文整理汇总了Java中org.jbehave.core.failures.PendingStepStrategy类的典型用法代码示例。如果您正苦于以下问题:Java PendingStepStrategy类的具体用法?Java PendingStepStrategy怎么用?Java PendingStepStrategy使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PendingStepStrategy类属于org.jbehave.core.failures包,在下文中一共展示了PendingStepStrategy类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: shouldHandlePendingStepsAccordingToStrategy
import org.jbehave.core.failures.PendingStepStrategy; //导入依赖的package包/类
@Test
public void shouldHandlePendingStepsAccordingToStrategy() throws Throwable {
// Given
StoryReporter reporter = mock(ConcurrentStoryReporter.class);
Step pendingStep = mock(Step.class);
StepResult pendingResult = pending("My step isn't defined!");
when(pendingStep.perform(null)).thenReturn(pendingResult);
PendingStepStrategy strategy = mock(PendingStepStrategy.class);
StepCollector collector = mock(StepCollector.class);
CandidateSteps mySteps = new Steps();
when(collector.collectScenarioSteps(eq(asList(mySteps)), (Scenario) anyObject(), eq(parameters))).thenReturn(
asList(pendingStep));
Story story = new Story(asList(new Scenario()));
givenStoryWithNoBeforeOrAfterSteps(story, false, collector, mySteps);
// When
StoryRunner runner = new StoryRunner();
runner.run(configurationWithPendingStrategy(collector, reporter,
strategy), asList(mySteps), story);
// Then
verify(strategy).handleFailure(pendingResult.getFailure());
}
示例2: shouldFailWithFailingUpongPendingStepsStrategy
import org.jbehave.core.failures.PendingStepStrategy; //导入依赖的package包/类
@Test(expected = PendingStepFound.class)
public void shouldFailWithFailingUpongPendingStepsStrategy() throws Throwable {
// Given
StoryReporter reporter = mock(ConcurrentStoryReporter.class);
Step pendingStep = mock(Step.class);
StepResult pendingResult = pending("My step isn't defined!");
when(pendingStep.perform(null)).thenReturn(pendingResult);
PendingStepStrategy strategy = new FailingUponPendingStep();
StepCollector collector = mock(StepCollector.class);
CandidateSteps mySteps = new Steps();
when(collector.collectScenarioSteps(eq(asList(mySteps)), (Scenario) anyObject(), eq(parameters))).thenReturn(
asList(pendingStep));
Story story = new Story(asList(new Scenario()));
givenStoryWithNoBeforeOrAfterSteps(story, false, collector, mySteps);
// When
StoryRunner runner = new StoryRunner();
runner.run(configurationWithPendingStrategy(collector, reporter,
strategy), asList(mySteps), story);
// Then ... fail as expected
}
示例3: shouldNotAllowModificationOfConfigurationElements
import org.jbehave.core.failures.PendingStepStrategy; //导入依赖的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);
}
示例4: buildConfiguration
import org.jbehave.core.failures.PendingStepStrategy; //导入依赖的package包/类
/**
* Builds a Configuration instance based on annotation {@link Configure}
* found in the annotated object instance
*
* @return A Configuration instance
*/
public Configuration buildConfiguration() throws AnnotationRequired {
if (!finder.isAnnotationPresent(Configure.class)) {
// not using annotation configuration, default to most useful
// configuration
return new MostUsefulConfiguration();
}
Configuration configuration = configurationElement(finder, "using", Configuration.class);
configuration.useKeywords(configurationElement(finder, "keywords", Keywords.class));
configuration.useFailureStrategy(configurationElement(finder, "failureStrategy", FailureStrategy.class));
configuration.usePendingStepStrategy(configurationElement(finder, "pendingStepStrategy",
PendingStepStrategy.class));
configuration.useParanamer(configurationElement(finder, "paranamer", Paranamer.class));
configuration.useStoryControls(configurationElement(finder, "storyControls", StoryControls.class));
configuration.useStepCollector(configurationElement(finder, "stepCollector", StepCollector.class));
configuration.useStepdocReporter(configurationElement(finder, "stepdocReporter", StepdocReporter.class));
configuration.useStepFinder(configurationElement(finder, "stepFinder", StepFinder.class));
configuration.useStepMonitor(configurationElement(finder, "stepMonitor", StepMonitor.class));
configuration.useStepPatternParser(configurationElement(finder, "stepPatternParser", StepPatternParser.class));
configuration.useStoryLoader(configurationElement(finder, "storyLoader", StoryLoader.class));
configuration.useStoryParser(configurationElement(finder, "storyParser", StoryParser.class));
configuration.useStoryPathResolver(configurationElement(finder, "storyPathResolver", StoryPathResolver.class));
configuration
.useDefaultStoryReporter(configurationElement(finder, "defaultStoryReporter", StoryReporter.class));
configuration.useStoryReporterBuilder(configurationElement(finder, "storyReporterBuilder",
StoryReporterBuilder.class));
configuration.useViewGenerator(configurationElement(finder, "viewGenerator", ViewGenerator.class));
configuration.useParameterConverters(parameterConverters(finder));
configuration.useParameterControls(configurationElement(finder, "parameterControls", ParameterControls.class));
configuration.usePathCalculator(configurationElement(finder, "pathCalculator", PathCalculator.class));
return configuration;
}
示例5: configurationWith
import org.jbehave.core.failures.PendingStepStrategy; //导入依赖的package包/类
private Configuration configurationWith(final StoryParser parser, final StoryLoader loader, final StoryReporter reporter,
final StepCollector collector, final FailureStrategy failureStrategy, final PendingStepStrategy pendingStrategy) {
return new MostUsefulConfiguration() {
@Override
public StoryReporter storyReporter(String storyPath) {
return reporter;
}
}.useStoryParser(parser)
.useStoryLoader(loader)
.useStepCollector(collector)
.useFailureStrategy(failureStrategy)
.usePendingStepStrategy(pendingStrategy);
}
示例6: pendingStepStrategy
import org.jbehave.core.failures.PendingStepStrategy; //导入依赖的package包/类
public PendingStepStrategy pendingStepStrategy() {
return pendingStepStrategy;
}
示例7: usePendingStepStrategy
import org.jbehave.core.failures.PendingStepStrategy; //导入依赖的package包/类
public Configuration usePendingStepStrategy(PendingStepStrategy pendingStepStrategy) {
this.pendingStepStrategy = pendingStepStrategy;
return this;
}
示例8: pendingStepStrategy
import org.jbehave.core.failures.PendingStepStrategy; //导入依赖的package包/类
public PendingStepStrategy pendingStepStrategy() {
return delegate.pendingStepStrategy();
}
示例9: usePendingStepStrategy
import org.jbehave.core.failures.PendingStepStrategy; //导入依赖的package包/类
@Override
public Configuration usePendingStepStrategy(PendingStepStrategy pendingStepStrategy) {
throw notAllowed();
}
示例10: withPendingStepStrategy
import org.jbehave.core.failures.PendingStepStrategy; //导入依赖的package包/类
public CrossReference withPendingStepStrategy(PendingStepStrategy pendingStepStrategy) {
this.pendingStepStrategy = pendingStepStrategy;
return this;
}
示例11: configurationWithPendingStrategy
import org.jbehave.core.failures.PendingStepStrategy; //导入依赖的package包/类
private Configuration configurationWithPendingStrategy(StepCollector collector, StoryReporter reporter,
PendingStepStrategy strategy) {
return configurationWith(new RegexStoryParser(), new LoadFromClasspath(), reporter, collector,
new RethrowingFailure(), strategy);
}
示例12: pendingStepStrategy
import org.jbehave.core.failures.PendingStepStrategy; //导入依赖的package包/类
/**
* <p>
* If the system property {@link #FAIL_ON_PENDING} is set, returns
* {@link FailingUponPendingStep} otherwise returns the default.
* </p>
* <p>
* Setting {@link #FAIL_ON_PENDING} will cause pending steps to fail story
* execution, so you can see if any steps don't match or are still to be
* implemented.
* </p>
*/
public PendingStepStrategy pendingStepStrategy() {
if (System.getProperty(FAIL_ON_PENDING) == null) {
return super.pendingStepStrategy();
}
return new FailingUponPendingStep();
}