本文整理汇总了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);
}
}
示例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);
}
示例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));
}
示例4: storyCancelled
import org.jbehave.core.model.StoryDuration; //导入依赖的package包/类
@Override
public void storyCancelled(Story story, StoryDuration storyDuration) {
}
示例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);
}
示例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);
}
示例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");
}
示例8: storyTimeout
import org.jbehave.core.model.StoryDuration; //导入依赖的package包/类
public void storyTimeout(Story story, StoryDuration storyDuration) {
}
示例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");
}
示例10: storyTimeout
import org.jbehave.core.model.StoryDuration; //导入依赖的package包/类
public void storyTimeout(Story story, StoryDuration storyDuration) {
delegate.storyTimeout(story, storyDuration);
}
示例11: storyCancelled
import org.jbehave.core.model.StoryDuration; //导入依赖的package包/类
public void storyCancelled(Story story, StoryDuration storyDuration) {
}
示例12: storyCancelled
import org.jbehave.core.model.StoryDuration; //导入依赖的package包/类
public void storyCancelled(Story story, StoryDuration storyDuration) {
this.outputStory.cancelled = true;
this.outputStory.storyDuration = storyDuration;
}
示例13: getStoryDuration
import org.jbehave.core.model.StoryDuration; //导入依赖的package包/类
public StoryDuration getStoryDuration() {
return storyDuration;
}
示例14: storyCancelled
import org.jbehave.core.model.StoryDuration; //导入依赖的package包/类
public void storyCancelled(Story story, StoryDuration storyDuration) {
add("cancelled");
}
示例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()));
}