Skip to content

Commit

Permalink
JBEHAVE-1598 Fix leftovers of storyTimeoutInSecs removal
Browse files Browse the repository at this point in the history
  • Loading branch information
valfirst authored Dec 29, 2023
1 parent 5a5b835 commit 95d9374
Show file tree
Hide file tree
Showing 17 changed files with 19 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class MyStories extends JUnitStories {

public MyStories() {
configuredEmbedder().embedderControls().doGenerateViewAfterStories(true).doIgnoreFailureInStories(true)
.doIgnoreFailureInView(true).useThreads(2).useStoryTimeoutInSecs(60);
.doIgnoreFailureInView(true).useThreads(2).useStoryTimeouts("60");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public class MyStories extends JUnitStories {

public MyStories() {
configuredEmbedder().embedderControls().doGenerateViewAfterStories(true).doIgnoreFailureInStories(true)
.doIgnoreFailureInView(true).useThreads(2).useStoryTimeoutInSecs(60);
.doIgnoreFailureInView(true).useThreads(2).useStoryTimeouts("60");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class MyStories extends JUnitStories {

public MyStories() {
configuredEmbedder().embedderControls().doGenerateViewAfterStories(true).doIgnoreFailureInStories(true)
.doIgnoreFailureInView(true).useThreads(2).useStoryTimeoutInSecs(60);
.doIgnoreFailureInView(true).useThreads(2).useStoryTimeouts("60");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class MyStories extends JUnitStories {

public MyStories() {
configuredEmbedder().embedderControls().doGenerateViewAfterStories(true).doIgnoreFailureInStories(true)
.doIgnoreFailureInView(true).useThreads(2).useStoryTimeoutInSecs(60);
.doIgnoreFailureInView(true).useThreads(2).useStoryTimeouts("60");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class MyStories extends JUnitStories {

public MyStories() {
configuredEmbedder().embedderControls().doGenerateViewAfterStories(true).doIgnoreFailureInStories(true)
.doIgnoreFailureInView(true).useThreads(2).useStoryTimeoutInSecs(60);
.doIgnoreFailureInView(true).useThreads(2).useStoryTimeouts("60");
}

@Override
Expand Down
6 changes: 3 additions & 3 deletions distribution/src/site/content/configuration.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ <h3>Using AnnotatedEmbedder</h3>
@Configure(storyControls = MyStoryControls.class, storyLoader = MyStoryLoader.class, storyReporterBuilder = MyReportBuilder.class,
parameterConverters = { MyDateConverter.class })
@UsingEmbedder(embedder = Embedder.class, generateViewAfterStories = true, ignoreFailureInStories = true, ignoreFailureInView = true, verboseFailures = true,
storyTimeoutInSecs = 100, threads = 2, metaFilters = "-skip")
storyTimeouts = "100", threads = 2, metaFilters = "-skip")
@UsingSteps(instances = { TraderSteps.class, BeforeAfterSteps.class, AndSteps.class, CalendarSteps.class,
PriorityMatchingSteps.class, SandpitSteps.class, SearchSteps.class })
public class AnnotatedTraderEmbedder extends InjectableEmbedder {
Expand Down Expand Up @@ -119,7 +119,7 @@ <h3>Using AnnotationBuilder</h3>
@Configure(storyLoader = MyStoryLoader.class, storyReporterBuilder = MyReportBuilder.class,
parameterConverters = { MyDateConverter.class })
@UsingEmbedder(embedder = Embedder.class, generateViewAfterStories = true, ignoreFailureInStories = true, ignoreFailureInView = true, verboseFailures = true,
storyTimeoutInSecs = 100, threads = 2, metaFilters = "-skip")
storyTimeouts = "100", threads = 2, metaFilters = "-skip")
@UsingSteps(instances = { TraderSteps.class, BeforeAfterSteps.class, AndSteps.class, CalendarSteps.class,
PriorityMatchingSteps.class, SandpitSteps.class })
public class TraderAnnotatedEmbedder {
Expand Down Expand Up @@ -193,7 +193,7 @@ <h3>Using ConfigurableEmbedder</h3>

public TraderStory() {
configuredEmbedder().embedderControls().doGenerateViewAfterStories(true).doIgnoreFailureInStories(true)
.doIgnoreFailureInView(true).useThreads(2).useStoryTimeoutInSecs(60);
.doIgnoreFailureInView(true).useThreads(2).useStoryTimeouts("60");
// Uncomment to set meta filter, which can also be set via Maven
// configuredEmbedder().useMetaFilters(Arrays.asList("+theme parametrisation"));
}
Expand Down
4 changes: 2 additions & 2 deletions distribution/src/site/content/developing-stories.html
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ <h3>JUnit-enabled Embeddables</h3>

public TraderStory() {
configuredEmbedder().embedderControls().doGenerateViewAfterStories(true).doIgnoreFailureInStories(true)
.doIgnoreFailureInView(true).useThreads(2).useStoryTimeoutInSecs(60);
.doIgnoreFailureInView(true).useThreads(2).useStoryTimeouts("60");
// Uncomment to set meta filter, which can also be set via Maven
// configuredEmbedder().useMetaFilters(Arrays.asList("+theme parametrisation"));
}
Expand Down Expand Up @@ -212,7 +212,7 @@ <h3>JUnit-enabled Embeddables</h3>

public TraderStories() {
configuredEmbedder().embedderControls().doGenerateViewAfterStories(true).doIgnoreFailureInStories(false)
.doIgnoreFailureInView(true).doVerboseFailures(true).useThreads(2).useStoryTimeoutInSecs(60);
.doIgnoreFailureInView(true).doVerboseFailures(true).useThreads(2).useStoryTimeouts("60");
//configuredEmbedder().useEmbedderControls(new PropertyBasedEmbedderControls());
}

Expand Down
13 changes: 5 additions & 8 deletions distribution/src/site/content/maven-goals.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,10 @@ <h2>Maven Goals</h2>
<li>ignoreFailureInStories: [true|false], defaults to <b>false</b></li>
<li>ignoreFailureInView: [true|false], defaults to <b>false</b></li>
<li>generateViewAfterStories: [true|false], defaults to <b>true</b></li>
<li>storyTimeoutInSecs: defaults to <b>300</b></li>
<li>storyTimeoutInSecsByPath: defaults to <b>300 (the default of storyTimeoutInSecs)</b></li>
<li>storyTimeouts: defaults to <b>300</b></li>
<ul>
<li>Overrides the default value in storyTimeoutInSecs, and can be expressed as a CSV of regex
<br>expressions matching story paths. E.g. "*/long/.story:5000,*/short/.story:200,*/medium/m_story.story:1000"</br></li>
<li>Can be expressed as a CSV of regex expressions matching story paths. E.g.
"*/long/.story:5000,*/short/.story:200,*/medium/m_story.story:1000"</li>
</ul>
<li>failOnStoryTimeout: [true|false], defaults to <b>false</b></li>
<li>threads: defaults to <b>1</b></li>
Expand All @@ -65,10 +64,8 @@ <h2>Maven Goals</h2>
href="javadoc/core/org/jbehave/core/io/StoryFinder.html">StoryFinder</a></li>
</ul>

<span class="followup">Performance Testing: You can make use of
<b>storyTimeoutInSecs</b> and <b>storyTimeoutInSecsByPath</b> to ensure
tests run under the time(s) specified
</span>
<span class="followup">Performance Testing: You can make use of <b>storyTimeouts</b> to ensure tests run under the
time(s) specified</span>

<p>In addition, the <b>unpack-view-resources</b> goal supports the properties:</p>

Expand Down
2 changes: 1 addition & 1 deletion distribution/src/site/content/reporting-stories.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ <h2>Story Reporters</h2>

public TraderStory() {
configuredEmbedder().embedderControls().doGenerateViewAfterStories(true).doIgnoreFailureInStories(true)
.doIgnoreFailureInView(true).useThreads(2).useStoryTimeoutInSecs(60);
.doIgnoreFailureInView(true).useThreads(2).useStoryTimeouts("60");
// Uncomment to set meta filter, which can also be set via Maven
// configuredEmbedder().useMetaFilters(Arrays.asList("+theme parametrisation"));
}
Expand Down
3 changes: 1 addition & 2 deletions examples/failing/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@
<generateViewAfterStories>true</generateViewAfterStories>
<ignoreFailureInStories>${ignore.failure.in.stories}</ignoreFailureInStories>
<ignoreFailureInView>${ignore.failure.in.view}</ignoreFailureInView>
<storyTimeoutInSecs>300</storyTimeoutInSecs>
<storyTimeoutInSecsByPath>**/and_*.story:8,**/*calendar.story:15</storyTimeoutInSecsByPath>
<storyTimeouts>**/and_*.story:8,**/*calendar.story:15,300</storyTimeouts>
<threads>${threads}</threads>
<metaFilters>
<metaFilter>${meta.filter}</metaFilter>
Expand Down
2 changes: 1 addition & 1 deletion examples/performance/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<excludes />
<batch>false</batch>
<threads>${threads}</threads>
<storyTimeoutInSecs>${story.timeout.in.secs}</storyTimeoutInSecs>
<storyTimeouts>${story.timeout.in.secs}</storyTimeouts>
<generateViewAfterStories>true</generateViewAfterStories>
<ignoreFailureInStories>${ignore.failure.in.stories}</ignoreFailureInStories>
<ignoreFailureInView>true</ignoreFailureInView>
Expand Down
2 changes: 1 addition & 1 deletion examples/threads/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<excludes />
<batch>false</batch>
<threads>${threads}</threads>
<storyTimeoutInSecs>${story.timeout.in.secs}</storyTimeoutInSecs>
<storyTimeouts>${story.timeout.in.secs}</storyTimeouts>
<generateViewAfterStories>true</generateViewAfterStories>
<ignoreFailureInStories>${ignore.failure.in.stories}</ignoreFailureInStories>
<ignoreFailureInView>true</ignoreFailureInView>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,6 @@ public void usingControls(EmbedderControls embedderControls) {
delegates.forEach(d -> d.usingControls(embedderControls));
}

@Override
public void invalidTimeoutFormat(String path) {
delegates.forEach(d -> d.invalidTimeoutFormat(path));
}

@Override
public void usingTimeout(String path, long timeout) {
delegates.forEach(d -> d.usingTimeout(path, timeout));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ void mapsViewGenerationFailed(File outputDirectory, StoryMaps storyMaps, Propert

void usingControls(EmbedderControls embedderControls);

void invalidTimeoutFormat(String path);

void usingTimeout(String path, long timeout);

}
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,6 @@ public void usingControls(EmbedderControls embedderControls) {
// Do nothing by default
}

@Override
public void invalidTimeoutFormat(String path) {
// Do nothing by default
}

@Override
public void usingTimeout(String path, long timeout) {
// Do nothing by default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,6 @@ public void usingExecutorService(ExecutorService executorService) {
public void usingControls(EmbedderControls embedderControls) {
print("Using controls %s", embedderControls);
}


@Override
public void invalidTimeoutFormat(String path) {
print("Failed to set specific story timeout for story %s because 'storyTimeoutInSecsByPath' has incorrect "
+ "format", path);
print("'storyTimeoutInSecsByPath' must be a CSV of regex expressions matching story paths. E.g. \"*/long/*"
+ ".story:5000,*/short/*.story:200\"");
}

@Override
public void usingTimeout(String path, long timeout) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -501,14 +501,6 @@ public void usingExecutorService(ExecutorService executorService) {
public void usingControls(EmbedderControls embedderControls) {
getLog().info("Using controls " + embedderControls);
}

@Override
public void invalidTimeoutFormat(String path) {
getLog().warn("Failed to set specific story timeout for story " + path
+ " because 'storyTimeoutInSecsByPath' has incorrect format");
getLog().warn("'storyTimeoutInSecsByPath' must be a CSV of regex expressions matching story paths. "
+ "E.g. \"*/long/*.story:5000,*/short/*.story:200\"");
}

@Override
public void usingTimeout(String path, long timeout) {
Expand Down

0 comments on commit 95d9374

Please sign in to comment.