[ https://jira.codehaus.org/browse/JBEHAVE-746?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mauro Talevi resolved JBEHAVE-746. ---------------------------------- Resolution: Fixed Applied patch with thanks. > ReportsCount is counting files that aren't stories in the story count > --------------------------------------------------------------------- > > Key: JBEHAVE-746 > URL: https://jira.codehaus.org/browse/JBEHAVE-746 > Project: JBehave > Issue Type: Bug > Components: Core > Affects Versions: 3.5.4 > Reporter: David Tanner > Priority: Minor > Fix For: 3.6 > > Original Estimate: 1 hour > Remaining Estimate: 1 hour > > 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] -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email