ReportsCount is counting files that aren't stories in the story count

Description

Problem Statement:
When running the JBehave tests, the ReportsCount that is output to the JUnit console is counting non-story Reports.

Example:
This is what the code currently returns:
org.jbehave.core.embedder.Embedder$RunningStoriesFailed: Failures in running stories: ReportsCount[stories=9,storiesNotAllowed=0,storiesPending=0,scenarios=1,scenariosFailed=1,scenariosNotAllowed=0,scenariosPending=0,stepsFailed=1]

Proposed change:
Change line 121 of the TemplateViewGenerator to use a method that filters out Reports that don't have any scenarios.

current : int stories = reports.size();
proposed: int stories = storyCount();

private int storyCount(){
int storyCount = 0;
for (Report report : reports){
if (report.getStats().containsKey("scenarios")){
if (report.getStats().get("scenarios") > 0)
storyCount++;
}
}
return storyCount;
}

Results after change:
org.jbehave.core.embedder.Embedder$RunningStoriesFailed: Failures in running stories: ReportsCount[stories=1,storiesNotAllowed=0,storiesPending=0,scenarios=1,scenariosFailed=1,scenariosNotAllowed=0,scenariosPending=0,stepsFailed=1]

Assignee

Unassigned

Reporter

David Tanner

Labels

None

Time tracking

1h

Components

Fix versions

Affects versions

Priority

Minor
Configure