Skip to content

Commit

Permalink
Merge branch 'master' into pr/83
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/main/java/de/codecentric/jbehave/junit/monitoring/JUnitScenarioReporter.java
  • Loading branch information
AndreasEK committed Jan 18, 2017
2 parents 1bee414 + 502ec16 commit 97a6938
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 32 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -5,3 +5,6 @@ test_output
/target
/.project
/.classpath

.idea
*.iml
Expand Up @@ -46,12 +46,6 @@ public class JUnitScenarioReporter extends NullStoryReporter {
private PendingStepStrategy pendingStepStrategy = new PassingUponPendingStep();
private Keywords keywords;

/**
* Use to track whether any scenario in the current story has failed. This
* is useful to indicate a story has failed.
*/
private boolean anyScenarioFailedInCurrentStory = false;

private boolean notifyFinished = true;

public JUnitScenarioReporter(RunNotifier notifier, int totalTests,
Expand Down Expand Up @@ -83,7 +77,6 @@ public void beforeStory(Story story, boolean isGivenStory) {
givenStoryContext = true;

} else {
anyScenarioFailedInCurrentStory = false;
if (testCounter == 0) {
notifier.fireTestRunStarted(rootDescription);
}
Expand Down Expand Up @@ -129,17 +122,7 @@ public void afterStory(boolean isGivenStory) {
processBeforeScenario();
} else {
if (!failedSteps.contains(currentStoryDescription)) {
// IntelliJ 13.1 does not propogate a step failure up to the
// story level.
// When there is a step failure then notify that its story has
// also failed.
if (anyScenarioFailedInCurrentStory == false) {
notifier.fireTestFinished(currentStoryDescription);
} else {
notifier.fireTestFailure(new Failure(
currentStoryDescription, new RuntimeException(
"story failed!")));
}
notifier.fireTestFinished(currentStoryDescription);
if (currentStoryDescription.isTest())
{
testCounter++;
Expand Down Expand Up @@ -204,20 +187,7 @@ private Collection<Description> getAllDescendants(
public void afterScenario() {
logger.info("After Scenario: {}", currentScenario.getDisplayName());
if (!givenStoryContext) {
// IntelliJ 13.1 does not propogate a step failure up to the
// scenario level.
// When there is a step failure then notify that its scenario has
// also failed.
if (failedSteps.size() == 0) {
notifier.fireTestFinished(currentScenario);
} else {
notifier.fireTestFailure(new Failure(currentScenario,
new RuntimeException("scenario failed!")));
anyScenarioFailedInCurrentStory = true;
// TODO: Code review this. Do we really need to keep track of
// failed steps between scenarios?
failedSteps.clear();
}
notifier.fireTestFinished(currentScenario);
processAfterScenario();
moveToNextScenario();
}
Expand Down

0 comments on commit 97a6938

Please sign in to comment.