当前位置: 首页>>代码示例>>Java>>正文


Java PendingStepStrategy类代码示例

本文整理汇总了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());
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:24,代码来源:StoryRunnerBehaviour.java

示例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
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:23,代码来源:StoryRunnerBehaviour.java

示例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);
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:25,代码来源:UnmodifiableConfigurationBehaviour.java

示例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;
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:40,代码来源:AnnotationBuilder.java

示例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);
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:15,代码来源:StoryRunnerBehaviour.java

示例6: pendingStepStrategy

import org.jbehave.core.failures.PendingStepStrategy; //导入依赖的package包/类
public PendingStepStrategy pendingStepStrategy() {
    return pendingStepStrategy;
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:4,代码来源:Configuration.java

示例7: usePendingStepStrategy

import org.jbehave.core.failures.PendingStepStrategy; //导入依赖的package包/类
public Configuration usePendingStepStrategy(PendingStepStrategy pendingStepStrategy) {
    this.pendingStepStrategy = pendingStepStrategy;
    return this;
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:5,代码来源:Configuration.java

示例8: pendingStepStrategy

import org.jbehave.core.failures.PendingStepStrategy; //导入依赖的package包/类
public PendingStepStrategy pendingStepStrategy() {
    return delegate.pendingStepStrategy();
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:4,代码来源:UnmodifiableConfiguration.java

示例9: usePendingStepStrategy

import org.jbehave.core.failures.PendingStepStrategy; //导入依赖的package包/类
@Override
public Configuration usePendingStepStrategy(PendingStepStrategy pendingStepStrategy) {
    throw notAllowed();
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:5,代码来源:UnmodifiableConfiguration.java

示例10: withPendingStepStrategy

import org.jbehave.core.failures.PendingStepStrategy; //导入依赖的package包/类
public CrossReference withPendingStepStrategy(PendingStepStrategy pendingStepStrategy) {
    this.pendingStepStrategy = pendingStepStrategy;
    return this;
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:5,代码来源:CrossReference.java

示例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);
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:6,代码来源:StoryRunnerBehaviour.java

示例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();
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:18,代码来源:PropertyBasedConfiguration.java


注:本文中的org.jbehave.core.failures.PendingStepStrategy类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。