In junit-runner, fix an NPE in testFailure() for different scenarios

Review Request #2385 - Created June 17, 2015 and submitted

Information
Eric Ayers
pants
zundel/fix-testFailure
1234, 1703
20e5ace...
Reviewers
pants-reviews
fkorotkov, gmalmquist, jsirois, stuhood

In AntJunitXmlReportListener, there are cases where testFailed() is invoked without a class or invoked without testStarted() being called.

Some of these scenarios are outlined in http://junit.org/javadoc/latest/org/junit/runner/notification/RunListener.html

CI is running at https://travis-ci.org/pantsbuild/pants/builds/67211843

Added a unit test.

Also ran this in our repo. It got rid of the exceptions reported in issue #1234 popping onto the console of the form:

                    1) Test mechanism
                     java.lang.NullPointerException
                        at com.twitter.common.junit.runner.ConsoleRunner$StreamCapturingListener.testStarted(ConsoleRunner.java:205)
                        at com.twitter.common.junit.runner.ForwardingListener$3.fire(ForwardingListener.java:60)
                        at com.twitter.common.junit.runner.ForwardingListener.fire(ForwardingListener.java:34)
                        at com.twitter.common.junit.runner.ForwardingListener.testStarted(ForwardingListener.java:58)
                        at com.twitter.common.junit.runner.AbortableListener.testStarted(AbortableListener.java:29)

Issues

  • 0
  • 1
  • 0
  • 1
Description From Last Updated
Eric Ayers
Eric Ayers
Garrett Malmquist
Eric Ayers
John Sirois
John Sirois
Eric Ayers
Review request changed

Status: Closed (submitted)

Change Summary:

Thanks John. Commit e11cabc

Loading...