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


Java StoryDuration类代码示例

本文整理汇总了Java中org.jbehave.core.model.StoryDuration的典型用法代码示例。如果您正苦于以下问题:Java StoryDuration类的具体用法?Java StoryDuration怎么用?Java StoryDuration使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


StoryDuration类属于org.jbehave.core.model包,在下文中一共展示了StoryDuration类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: storyCancelled

import org.jbehave.core.model.StoryDuration; //导入依赖的package包/类
public void storyCancelled(Story story, StoryDuration storyDuration) {
    crossReferencing.storyCancelled(story, storyDuration);
    if (multiThreading) {
        delayedMethods.add(new DelayedMethod(storyCancelled, story, storyDuration));
    } else {
        delegate.storyCancelled(story, storyDuration);
    }
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:9,代码来源:ConcurrentStoryReporter.java

示例2: shouldReportStoryCancellation

import org.jbehave.core.model.StoryDuration; //导入依赖的package包/类
@Test
public void shouldReportStoryCancellation(){
    // Given
    Configuration configuration = mock(Configuration.class,Mockito.RETURNS_DEEP_STUBS);
    when(configuration.storyControls().dryRun()).thenReturn(false);
    StoryReporter reporter = mock(ConcurrentStoryReporter.class);
    when(configuration.storyReporter(Matchers.anyString())).thenReturn(reporter);
    
    Story story = mock(Story.class);
    String storyPath = "story/path";
    when(story.getPath()).thenReturn(storyPath);
    RuntimeException expected = new RuntimeException();
    when(story.getMeta()).thenThrow(expected);
    
    InjectableStepsFactory stepsFactory = mock(InjectableStepsFactory.class);
    MetaFilter metaFilter = mock(MetaFilter.class);
    State state = mock(State.class);

    //When
    long durationInSecs = 2;
    long timeoutInSecs = 1;
    StoryDuration storyDuration = new StoryDuration(durationInSecs, timeoutInSecs);
    try {
        StoryRunner runner = new StoryRunner();
        runner.cancelStory(story, storyDuration);
        runner.run(configuration, stepsFactory, story, metaFilter, state);
        fail("A exception should be thrown");
    } catch (Throwable e) {
    //Then
        assertThat(e.equals(expected), is(true));
    }        
    verify(reporter).storyCancelled(story, storyDuration);
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:34,代码来源:StoryRunnerBehaviour.java

示例3: testStoryIfTimeoutIsSet

import org.jbehave.core.model.StoryDuration; //导入依赖的package包/类
private void testStoryIfTimeoutIsSet(Answer<StoryRunner> answer) throws Throwable {
    // Given
    long timeoutInSecs = 1;

    StoryRunner runner = mock(StoryRunner.class);
    EmbedderMonitor monitor = mock(EmbedderMonitor.class);

    EmbedderControls embedderControls = new EmbedderControls().useStoryTimeoutInSecs(timeoutInSecs);

    Embedder embedder = embedderWith(runner, embedderControls, monitor);
    Configuration configuration = embedder.configuration();
    StoryPathResolver resolver = configuration.storyPathResolver();

    List<String> storyPaths = new ArrayList<String>();
    String storyPath = resolver.resolve(MyStory.class);
    storyPaths.add(storyPath);
    Story story = mockStory(Meta.EMPTY);
    when(story.getPath()).thenReturn(storyPath);
    when(runner.storyOfPath(configuration, storyPath)).thenReturn(story);

    Mockito.doAnswer(answer)
            .when(runner)
            .run(Matchers.any(Configuration.class), Matchers.any(InjectableStepsFactory.class), Matchers.eq(story),
                    Matchers.any(MetaFilter.class), Matchers.any(State.class));

    // When
    boolean exceptionWasThrown = false;
    try {
        embedder.runStoriesAsPaths(storyPaths);
    } catch (Exception exception) {
        exceptionWasThrown = true;
    }

    // Then
    assertThat(exceptionWasThrown, is(true));
    verify(runner).cancelStory(Matchers.eq(story), Matchers.any(StoryDuration.class));
    verify(monitor).storyTimeout(Matchers.eq(story), Matchers.any(StoryDuration.class));
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:39,代码来源:EmbedderBehaviour.java

示例4: storyCancelled

import org.jbehave.core.model.StoryDuration; //导入依赖的package包/类
@Override
public void storyCancelled(Story story, StoryDuration storyDuration) {
}
 
开发者ID:tumbarumba,项目名称:jbehave-specification-report,代码行数:4,代码来源:SpecificationStoryReporter.java

示例5: storyCancelled

import org.jbehave.core.model.StoryDuration; //导入依赖的package包/类
@Override
public void storyCancelled(Story story, StoryDuration storyDuration)
{
  // TODO: May 15, 2014 (fpedroza) - evaluate usefulness
  LOG.info("LoggingStoryReporter.storyCancelled() - {} {}", story, storyDuration);
}
 
开发者ID:partnet,项目名称:seauto,代码行数:7,代码来源:LoggingStoryReporter.java

示例6: storyTimeout

import org.jbehave.core.model.StoryDuration; //导入依赖的package包/类
public void storyTimeout(Story story, StoryDuration storyDuration) {
    log("Story " + story.getPath() + " duration of " + storyDuration.getDurationInSecs()
            + " seconds has exceeded timeout of " + storyDuration.getTimeoutInSecs() + " seconds", MSG_INFO);
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:5,代码来源:AbstractEmbedderTask.java

示例7: storyTimeout

import org.jbehave.core.model.StoryDuration; //导入依赖的package包/类
public void storyTimeout(Story story, StoryDuration storyDuration) {
    getLog().warn(
            "Story " + story.getPath() + " duration of " + storyDuration.getDurationInSecs()
                    + " seconds has exceeded timeout of " + storyDuration.getTimeoutInSecs() + " seconds");
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:6,代码来源:AbstractEmbedderMojo.java

示例8: storyTimeout

import org.jbehave.core.model.StoryDuration; //导入依赖的package包/类
public void storyTimeout(Story story, StoryDuration storyDuration) {
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:3,代码来源:NullEmbedderMonitor.java

示例9: storyTimeout

import org.jbehave.core.model.StoryDuration; //导入依赖的package包/类
public void storyTimeout(Story story, StoryDuration storyDuration) {
    print("Story " + story.getPath() + " duration of " + storyDuration.getDurationInSecs()
            + " seconds has exceeded timeout of " + storyDuration.getTimeoutInSecs() + " seconds");
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:5,代码来源:PrintStreamEmbedderMonitor.java

示例10: storyTimeout

import org.jbehave.core.model.StoryDuration; //导入依赖的package包/类
public void storyTimeout(Story story, StoryDuration storyDuration) {
    delegate.storyTimeout(story, storyDuration);
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:4,代码来源:EmbedderMonitorDecorator.java

示例11: storyCancelled

import org.jbehave.core.model.StoryDuration; //导入依赖的package包/类
public void storyCancelled(Story story, StoryDuration storyDuration) {
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:3,代码来源:NullStoryReporter.java

示例12: storyCancelled

import org.jbehave.core.model.StoryDuration; //导入依赖的package包/类
public void storyCancelled(Story story, StoryDuration storyDuration) {
    this.outputStory.cancelled = true;
    this.outputStory.storyDuration = storyDuration;
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:5,代码来源:TemplateableOutput.java

示例13: getStoryDuration

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

示例14: storyCancelled

import org.jbehave.core.model.StoryDuration; //导入依赖的package包/类
public void storyCancelled(Story story, StoryDuration storyDuration) {
    add("cancelled");
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:4,代码来源:PostStoryStatisticsCollector.java

示例15: storyCancelled

import org.jbehave.core.model.StoryDuration; //导入依赖的package包/类
public void storyCancelled(Story story, StoryDuration storyDuration) {
    print(format("storyCancelled", "{0}: {1} ({2} s)\n", keywords.storyCancelled(), keywords.duration(),
            storyDuration.getDurationInSecs()));
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:5,代码来源:PrintStreamOutput.java


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