Comments (4)
I haven't downloaded your project but I wonder does it help you if you do not hide the passed tests??? You have the Hide Passed tests option turned on in the top left hand corner of your screen shot.
Also can you provide the full text in the console? It seems like the runner is running your same my.story at least 3 times.
from jbehave-junit-runner.
Toggling the Hide Passed certainly helped, so we can assume the issue is resolved.
But still the console output doesn't seem "right", as if all scenarios were executed concurrently
:
Processing system properties {}
Using controls EmbedderControls[batch=false,skip=false,generateViewAfterStories=true,ignoreFailureInStories=true,ignoreFailureInView=true,verboseFailures=false,verboseFiltering=false,storyTimeoutInSecs=60,threads=2]
(BeforeStories)
Running story stories/my.story
(stories/my.story)
Scenario: 2 squared
Given a variable x with value 2
Given a variable x with value 2
Given a variable x with value 2
When I multiply x by 2
When I multiply x by 2
When I multiply x by 2
Then x should equal 4
Then x should equal 4
Then x should equal 4
Scenario: 3 squared
Scenario: 3 squared
Scenario: 3 squared
Given a variable x with value 3
Given a variable x with value 3
Given a variable x with value 3
When I multiply x by 3
When I multiply x by 3
When I multiply x by 3
Then x should equal 10 (FAILED)
Then x should equal 10 (FAILED)
Then x should equal 10 (FAILED)
(java.lang.RuntimeException: x is 9, but should be 10)
(java.lang.RuntimeException: x is 9, but should be 10)
(java.lang.RuntimeException: x is 9, but should be 10)
java.lang.RuntimeException: x is 9, but should be 10
at behave_test1.steps.MySteps.thenXshouldBe(MySteps.java:21)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.jbehave.core.steps.StepCreator$ParameterisedStep.perform(StepCreator.java:550)
at org.jbehave.core.embedder.StoryRunner$FineSoFar.run(StoryRunner.java:531)
at org.jbehave.core.embedder.StoryRunner.runStepsWhileKeepingState(StoryRunner.java:511)
at org.jbehave.core.embedder.StoryRunner.runScenarioSteps(StoryRunner.java:475)
at org.jbehave.core.embedder.StoryRunner.runCancellable(StoryRunner.java:308)
at org.jbehave.core.embedder.StoryRunner.run(StoryRunner.java:220)
at org.jbehave.core.embedder.StoryRunner.run(StoryRunner.java:181)
at org.jbehave.core.embedder.StoryManager$EnqueuedStory.call(StoryManager.java:229)
at org.jbehave.core.embedder.StoryManager$EnqueuedStory.call(StoryManager.java:201)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Scenario: 5 squared
Scenario: 5 squared
Scenario: 5 squared
Given a variable x with value 4
Given a variable x with value 4
Given a variable x with value 4
When I multiply x by 4
When I multiply x by 4
When I multiply x by 4
Then x should equal 10 (FAILED)
Then x should equal 10 (FAILED)
Then x should equal 10 (FAILED)
(java.lang.RuntimeException: x (java.lang.RuntimeException: x (java.lang.RuntimeException: x is 16, but should be 10)
is 16, but should be 10)
is 16, but should be 10)
java.lang.RuntimeException: x is 16, but should be 10
at behave_test1.steps.MySteps.thenXshouldBe(MySteps.java:21)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.jbehave.core.steps.StepCreator$ParameterisedStep.perform(StepCreator.java:550)
at org.jbehave.core.embedder.StoryRunner$FineSoFar.run(StoryRunner.java:531)
at org.jbehave.core.embedder.StoryRunner.runStepsWhileKeepingState(StoryRunner.java:511)
at org.jbehave.core.embedder.StoryRunner.runScenarioSteps(StoryRunner.java:475)
at org.jbehave.core.embedder.StoryRunner.runCancellable(StoryRunner.java:308)
at org.jbehave.core.embedder.StoryRunner.run(StoryRunner.java:220)
at org.jbehave.core.embedder.StoryRunner.run(StoryRunner.java:181)
at org.jbehave.core.embedder.StoryManager$EnqueuedStory.call(StoryManager.java:229)
at org.jbehave.core.embedder.StoryManager$EnqueuedStory.call(StoryManager.java:201)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Failed to run story stories/my.story
java.lang.RuntimeException: x is 9, but should be 10
at behave_test1.steps.MySteps.thenXshouldBe(MySteps.java:21)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.jbehave.core.steps.StepCreator$ParameterisedStep.perform(StepCreator.java:550)
at org.jbehave.core.embedder.StoryRunner$FineSoFar.run(StoryRunner.java:531)
at org.jbehave.core.embedder.StoryRunner.runStepsWhileKeepingState(StoryRunner.java:511)
at org.jbehave.core.embedder.StoryRunner.runScenarioSteps(StoryRunner.java:475)
at org.jbehave.core.embedder.StoryRunner.runCancellable(StoryRunner.java:308)
at org.jbehave.core.embedder.StoryRunner.run(StoryRunner.java:220)
at org.jbehave.core.embedder.StoryRunner.run(StoryRunner.java:181)
at org.jbehave.core.embedder.StoryManager$EnqueuedStory.call(StoryManager.java:229)
at org.jbehave.core.embedder.StoryManager$EnqueuedStory.call(StoryManager.java:201)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
(AfterStories)
Generating reports view to 'C:\Documents and Settings\Piotrek\IdeaProjects\jbeh1\target\jbehave' using formats '[stats, console, txt, html, xml, junitscenarioreporter]' and view properties '{defaultFormats=stats, decorateNonHtml=true, viewDirectory=view, decorated=ftl/jbehave-report-decorated.ftl, reports=ftl/jbehave-reports-with-totals.ftl, maps=ftl/jbehave-maps.ftl, navigator=ftl/jbehave-navigator.ftl, views=ftl/jbehave-views.ftl, nonDecorated=ftl/jbehave-report-non-decorated.ftl}'
Reports view generated with 2 stories (of which 0 pending) containing 6 scenarios (of which 0 pending)
Failures in reports view: 4 scenarios failed
And with tests shown:
from jbehave-junit-runner.
It is recommended to not run using multiple threads if you look at the Enabling section of the wiki. It is suggested to use JUnitReportingRunner.recommendedControls() which sets single threaded behaviour:
public static EmbedderControls recommendedControls(Embedder embedder) {
return embedder.embedderControls()
// don't throw an exception on generating reports for failing stories
.doIgnoreFailureInView(true)
// don't throw an exception when a story failed
.doIgnoreFailureInStories(true)
// .doVerboseFailures(true)
.useThreads(1);
}
from jbehave-junit-runner.
Ok, but I thought specification says that a single .story is always executed by one thread, so it should't be an issue here. All displayed tests are part of the same story.
from jbehave-junit-runner.
Related Issues (20)
- Move to JUnit 5
- Suggestion on using this with WeldAnnotatedEmbedderRunner
- Handle RestartingScenarioFailure HOT 1
- Filtering out all scenarios in the story file causes NPE HOT 9
- How to make Junit runner read limited words from scenario and create .xml file from it. HOT 4
- I cannot start single scenario in eclipse HOT 5
- NPE on Failure.getTestHeader(Failure.java:44) when step throws assert in Lifecycle>After>FAILURE
- Using JUnitReportingRunner with pitest HOT 2
- Export the report in any other format
- Tests failing on master HOT 2
- How to generate the jbehave-surefire.xml file with parametrised examples HOT 5
- Inconsistent versions HOT 10
- Throws RuntimeException on scenario failure instead of java.lang.AssertionError HOT 2
- jbehave-junit-runner by maven and not from IDE HOT 7
- Jbehave-junit-runner incorrectly shows scenarios being executed when mata keywords applied in Jbehave 4 version HOT 13
- bad checksum on repo1.maven.org HOT 1
- Not showing correct test names in IntelliJ HOT 7
- Customize output monitor HOT 1
- Comments in scenario are reported as ignored HOT 10
- Remove fix for special IntelliJ handling
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jbehave-junit-runner.