damianszczepanik / cucumber-reporting

HTML reports for Cucumber
GNU Lesser General Public License v2.1
548 stars 403 forks source link

One "pending" status in the JSON file make the generation fail #23

Closed fdegrigny closed 9 years ago

fdegrigny commented 11 years ago

If there is a "status":"pending" in the JSON file, this make the parser crash with this following NPE (and the report generation fails) : java.lang.NullPointerException at net.masterthought.cucumber.json.Step$predicates$1.matches(Step.java:171) at net.masterthought.cucumber.json.Step$predicates$1.matches(Step.java:168) at com.googlecode.totallylazy.iterators.FilterIterator.getNext(FilterIterator.java:20) at com.googlecode.totallylazy.iterators.StatefulIterator.hasNext(StatefulIterator.java:23) at com.googlecode.totallylazy.Iterators.size(Iterators.java:347) at com.googlecode.totallylazy.Sequences.size(Sequences.java:384) at com.googlecode.totallylazy.Sequence.size(Sequence.java:245) at net.masterthought.cucumber.json.Element.getStatus(Element.java:36) at net.masterthought.cucumber.ReportInformation.processFeatures(ReportInformation.java:225) at net.masterthought.cucumber.ReportInformation.(ReportInformation.java:41) at net.masterthought.cucumber.ReportBuilder.(ReportBuilder.java:39) at net.masterthought.cucumber.CucumberReportGeneratorMojo.execute(CucumberReportGeneratorMojo.java:61) ... 21 more

The expected behavior is to deal this "pending" status like the "undefined" one. (If we replace manually all the "prending" status by "undefined" ones : the generation is OK)

Regards.

kingsleyh commented 11 years ago

Hi - thanks for raising this - I will fix this also in the next release

On 18 Apr 2013, at 13:27, fdegrigny notifications@github.com wrote:

If there is a "status":"pending" in the JSON file, yhis make the parser crash with this following NPE (and the report generation fails) : java.lang.NullPointerException at net.masterthought.cucumber.json.Step$predicates$1.matches(Step.java:171) at net.masterthought.cucumber.json.Step$predicates$1.matches(Step.java:168) at com.googlecode.totallylazy.iterators.FilterIterator.getNext(FilterIterator.java:20) at com.googlecode.totallylazy.iterators.StatefulIterator.hasNext(StatefulIterator.java:23) at com.googlecode.totallylazy.Iterators.size(Iterators.java:347) at com.googlecode.totallylazy.Sequences.size(Sequences.java:384) at com.googlecode.totallylazy.Sequence.size(Sequence.java:245) at net.masterthought.cucumber.json.Element.getStatus(Element.java:36) at net.masterthought.cucumber.ReportInformation.processFeatures(ReportInformation.java:225) at net.masterthought.cucumber.ReportInformation.(ReportInformation.java:41) at net.masterthought.cucumber.ReportBuilder.(ReportBuilder.java:39) at net.masterthought.cucumber.CucumberReportGeneratorMojo.execute(CucumberReportGeneratorMojo.java:61) ... 21 more

The expected behavior is to deal this "pending" status like the "undefined" one. (If we replace manually all the "prending" status by "undefined" ones : the generation is OK)

Regards.

— Reply to this email directly or view it on GitHub.

fdegrigny commented 11 years ago

You're welcome. Waiting the next release, there is a workaround using AntRun Maven goal : <plugin>   <artifactId>maven-antrun-plugin</artifactId>   <version>1.7</version>   <executions>     <execution>       <id>filter-json-status</id>       <phase>post-integration-test</phase>       <goals>         <goal>run</goal>       </goals>       <configuration>         <target>           <!-- filter the JSON report : hack for a maven-cucumber-reporting bug ! -->           <!-- (Its parser doesn't recognize the 'pending' status yet) -->           <replace file="${project.build.directory}/cucumber.json">             <replacetoken><![CDATA["status":"pending"]]></replacetoken>             <replacevalue><![CDATA["status":"undefined"]]></replacevalue>           </replace>         </target>       </configuration>     </execution>   </executions> </plugin>

kingsleyh commented 11 years ago

fixed in pending release