surefire-report plugin not compatible with Jrockit JVM
------------------------------------------------------
Key: SUREFIRE-429
URL: http://jira.codehaus.org/browse/SUREFIRE-429
Project: Maven Surefire
Issue Type: Bug
Components: plugin
Affects Versions: 2.3.1
Environment: Linux Jrockit : jrockit-j2sdk1.4.2_08
Reporter: Brian Harper
When running mvn surefire-report:report (or report-only), I encountered an exception:
[INFO] An error has occurred in Maven Surefire Report report generation.
Embedded error: String index out of range: -44
The stack trace shows the following:
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -44
at java.lang.String.substring(II)Ljava/lang/String;(Unknown Source)
at org.apache.maven.plugins.surefire.report.SurefireReportGenerator.getErrorLineNumber(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;(SurefireReportGenerator.java:608)
Looking at the code for SurefireReportGenerator.java, I see that in getErrorLineNumber, the
following code is used to parse the test error report to find the line number:
if ( token.startsWith( className ) )
{
int idx = token.indexOf( ":" );
lineNo = token.substring( idx + 1, token.indexOf( ")" ) );
break;
}
This works fine if the Sun JVM's stack trace format:
at net.company.package.MyClassTest.testMethod(MyClassTest.java:95)
But here's what the stack trace looks like with Jrockit:
at net.company.package.MyClassTest.testMethod()V(MyClassTest.java:95)
Sure enough, if I swith to the Sun JVM and rerun, the report is generated successfully.
The parsing logic should be fixed to look for the last occurence of a close parentheses rather
than the first.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|