[
https://jira.codehaus.org/browse/SUREFIRE-1041?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Andreas Gudian reassigned SUREFIRE-1041:
----------------------------------------
Assignee: Andreas Gudian
> JUnit47 provider: Exception in JUnit Runner can crash test run without
> visible stack trace
> ------------------------------------------------------------------------------------------
>
> Key: SUREFIRE-1041
> URL: https://jira.codehaus.org/browse/SUREFIRE-1041
> Project: Maven Surefire
> Issue Type: Bug
> Reporter: Dan Fabulich
> Assignee: Andreas Gudian
> Fix For: 2.17
>
> Attachments: SUREFIRE-1041.patch, SUREFIRE-1041-testcase.zip
>
>
> Run the attached Maven project. Surefire is configured to use the JUnit47
> provider. There's one test, marked with @RunWith(BadRunner.class); the
> BadRunner class throws a NullPointerException in its "run" method.
> Expected: The tests should fail with a visible stacktrace; that's what
> happens when you don't use the JUnit47 provider.
> Actual: The tests fail with this unhelpful error:
> {code}
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-surefire-plugin:2.16:test (default-test) on
> project test: Execution default-test of goal
> org.apache.maven.plugins:maven-surefire-plugin:2.16:test failed:
> java.lang.RuntimeException: null,null,null,null,null: source is null -> [Help
> 1]
> {code}
> I'm also attaching a patch that fixes this problem: SimpleReportEntry should
> not throw a NPE with a null source/name, but should instead just accept them
> and convert them to the string "null." This allows the test to fail naturally
> and render the stacktrace in the console output and in surefire reports.
--
This message was sent by Atlassian JIRA
(v6.1.6#6162)