Can't make surefire reports when a test fails

10 views
Skip to first unread message

Ernst

unread,
May 6, 2009, 10:42:53 AM5/6/09
to tellurium-users
Hi,

I can't make a surefire reports when there is a test that fails (on
purpose here for example).
I'm using the provided maven archetype.
Is this something Tellurium related or is it a problem with Surefire?
Can anyone reproduce it?

mvn -X -e surefire-report:report -Dtest=SomethingTestCase

...cut...
16:35:53.591 INFO - Stopped HttpContext[/,/]
16:35:53.592 INFO - Stopped org.mortbay.jetty.Server@c4bc34
Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 20.649
sec <<< FAILURE!

Results :

Failed tests:
testDuplicateName(test.SomethingTestCase)

Tests run: 2, Failures: 1, Errors: 0, Skipped: 0

[ERROR] There are test failures.

Please refer to /home/ernst/Projekt/Tellurium/tellurium_p4/testing/
tellurium-tests/target/surefire-reports for the individual test
results.
[DEBUG] Plugin dependencies for:

org.apache.maven.plugins:maven-surefire-report-plugin:2.4.3

are:

org.apache.maven.reporting:maven-reporting-api:jar:2.0:runtime
org.apache.maven.reporting:maven-reporting-impl:jar:2.0:runtime
org.codehaus.plexus:plexus-utils:jar:1.1:runtime


[DEBUG] org.apache.maven.plugins:maven-surefire-report-plugin:maven-
plugin:2.4.3:runtime (selected for runtime)
[DEBUG] Retrieving parent-POM: org.apache.maven.reporting:maven-
reporting:pom:2.0 for project: null:maven-reporting-api:jar:2.0 from
the repository.
[DEBUG] Adding managed dependencies for unknown:maven-reporting-api
[DEBUG] org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.0.4
[DEBUG] org.apache.maven.wagon:wagon-provider-api:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-ssh:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-file:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-http-lightweight:jar:1.0-
alpha-5
[DEBUG] org.apache.maven.reporting:maven-reporting-api:jar:
2.0:runtime (selected for runtime)
[DEBUG] doxia:doxia-sink-api:jar:1.0-alpha-4:runtime (selected for
runtime)
[DEBUG] Adding managed dependencies for unknown:maven-reporting-impl
[DEBUG] org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.0.4
[DEBUG] org.apache.maven.wagon:wagon-provider-api:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-ssh:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-file:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-http-lightweight:jar:1.0-
alpha-5
[DEBUG] org.apache.maven.reporting:maven-reporting-impl:jar:
2.0:runtime (selected for runtime)
[DEBUG] Adding managed dependencies for unknown:maven-project
[DEBUG] org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.0.4
[DEBUG] org.apache.maven.wagon:wagon-provider-api:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-ssh:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-file:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-http-lightweight:jar:1.0-
alpha-5
[DEBUG] org.apache.maven:maven-project:jar:2.0:runtime (selected
for runtime)
[DEBUG] Adding managed dependencies for unknown:maven-profile
[DEBUG] org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.0.4
[DEBUG] org.apache.maven.wagon:wagon-provider-api:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-ssh:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-file:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-http-lightweight:jar:1.0-
alpha-5
[DEBUG] org.apache.maven:maven-profile:jar:2.0:runtime (selected
for runtime)
[DEBUG] Adding managed dependencies for org.apache.maven:maven-model
[DEBUG] org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.0.4
[DEBUG] org.apache.maven.wagon:wagon-provider-api:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-ssh:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-file:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-http-lightweight:jar:1.0-
alpha-5
[DEBUG] org.apache.maven:maven-model:jar:2.0:runtime (selected
for runtime)
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.0.4:runtime
(applying version: 1.5.1)
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.5.1:runtime
(selected for runtime)
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.0.4:runtime
(applying version: 1.5.1)
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.5.1:runtime
(selected for runtime)
[DEBUG] org.codehaus.plexus:plexus-container-default:jar:1.0-
alpha-8:runtime (selected for runtime)
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.0.4:runtime
(applying version: 1.5.1)
[DEBUG] junit:junit:jar:3.8.1:runtime (selected for runtime)
[DEBUG] classworlds:classworlds:jar:1.1-alpha-2:runtime
(selected for runtime)
[DEBUG] org.apache.maven:maven-model:jar:2.0:runtime (selected
for runtime)
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.0.4:runtime
(applying version: 1.5.1)
[DEBUG] Adding managed dependencies for org.apache.maven:maven-
artifact-manager
[DEBUG] org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.0.4
[DEBUG] org.apache.maven.wagon:wagon-provider-api:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-ssh:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-file:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-http-lightweight:jar:1.0-
alpha-5
[DEBUG] org.apache.maven:maven-artifact-manager:jar:2.0:runtime
(selected for runtime)
[DEBUG] Adding managed dependencies for org.apache.maven:maven-
repository-metadata
[DEBUG] org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.0.4
[DEBUG] org.apache.maven.wagon:wagon-provider-api:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-ssh:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-file:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-http-lightweight:jar:1.0-
alpha-5
[DEBUG] org.apache.maven:maven-repository-metadata:jar:
2.0:runtime (selected for runtime)
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.0.4:runtime
(applying version: 1.5.1)
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.0.4:runtime
(applying version: 1.5.1)
[DEBUG] org.apache.maven:maven-artifact:jar:2.0:runtime
(selected for runtime)
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.0.4:runtime
(applying version: 1.5.1)
[DEBUG] org.apache.maven.wagon:wagon-provider-api:jar:1.0-
alpha-5:runtime (selected for runtime)
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.0.4:runtime
(applying version: 1.5.1)
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.0.4:runtime
(applying version: 1.5.1)
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.5.1:runtime
(selected for runtime)
[DEBUG] org.apache.maven:maven-artifact:jar:2.0:runtime
(selected for runtime)
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.0.4:runtime
(applying version: 1.5.1)
[DEBUG] org.codehaus.plexus:plexus-container-default:jar:1.0-
alpha-8:runtime (selected for runtime)
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.0.4:runtime
(applying version: 1.5.1)
[DEBUG] junit:junit:jar:3.8.1:runtime (selected for runtime)
[DEBUG] classworlds:classworlds:jar:1.1-alpha-2:runtime
(selected for runtime)
[DEBUG] commons-validator:commons-validator:jar:1.1.4:runtime
(selected for runtime)
[DEBUG] org.apache.maven:maven-plugin-api:jar:2.0:runtime
(selected for runtime)
[DEBUG] oro:oro:jar:2.0.7:runtime (selected for runtime)
[DEBUG] doxia:doxia-core:jar:1.0-alpha-4:runtime (selected for
runtime)
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.5.1:runtime (removed
- nearer found: 1.1)
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.1:runtime (selected
for runtime)
[DEBUG] The following artifacts were filtered out for plugin:
org.apache.maven.plugins:maven-surefire-report-plugin:2.4.3 because
they're already in the core of Maven:

org.apache.maven.reporting:maven-reporting-api:jar:2.0:runtime

These will use the artifact files already in the core ClassRealm
instead, to allow them to be included in PluginDescriptor.getArtifacts
().


[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-surefire-
report-plugin:2.4.3:report' -->
[DEBUG] (f) aggregate = false
[DEBUG] (f) linkXRef = true
[DEBUG] (f) outputDirectory = /home/ernst/Projekt/Tellurium/
tellurium_p4/testing/tellurium-tests/target/site
[DEBUG] (f) outputName = surefire-report
[DEBUG] (f) project = MavenProject: example:demo:1.0-SNAPSHOT @ /
home/ernst/Projekt/Tellurium/tellurium_p4/testing/tellurium-tests/
pom.xml
[DEBUG] (f) reactorProjects = [MavenProject: example:demo:1.0-
SNAPSHOT @ /home/ernst/Projekt/Tellurium/tellurium_p4/testing/
tellurium-tests/pom.xml]
[DEBUG] (f) showSuccess = true
[DEBUG] (f) xrefLocation = /home/ernst/Projekt/Tellurium/
tellurium_p4/testing/tellurium-tests/target/site/xref-test
[DEBUG] -- end configuration --
[INFO] [surefire-report:report]
[WARNING] Unable to locate Test Source XRef to link to - DISABLED
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] An error has occurred in Surefire Report report generation.

Embedded error: String index out of range: -1
[INFO]
------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: An error has
occurred in Surefire Report report generation.
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals
(DefaultLifecycleExecutor.java:703)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal
(DefaultLifecycleExecutor.java:553)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal
(DefaultLifecycleExecutor.java:523)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures
(DefaultLifecycleExecutor.java:371)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments
(DefaultLifecycleExecutor.java:332)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute
(DefaultLifecycleExecutor.java:181)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:
315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:
430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: An error
has occurred in Surefire Report report generation.
at org.apache.maven.reporting.AbstractMavenReport.execute
(AbstractMavenReport.java:79)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo
(DefaultPluginManager.java:483)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals
(DefaultLifecycleExecutor.java:678)
... 16 more
Caused by: java.lang.StringIndexOutOfBoundsException: String index out
of range: -1
at java.lang.String.substring(String.java:1938)
at
org.apache.maven.plugins.surefire.report.SurefireReportGenerator.getErrorLineNumber
(SurefireReportGenerator.java:638)
at
org.apache.maven.plugins.surefire.report.SurefireReportGenerator.constructFailureDetails
(SurefireReportGenerator.java:603)
at
org.apache.maven.plugins.surefire.report.SurefireReportGenerator.doGenerateReport
(SurefireReportGenerator.java:111)
at
org.apache.maven.plugins.surefire.report.SurefireReportMojo.executeReport
(SurefireReportMojo.java:180)
at org.apache.maven.reporting.AbstractMavenReport.generate
(AbstractMavenReport.java:98)
at org.apache.maven.reporting.AbstractMavenReport.execute
(AbstractMavenReport.java:73)
... 18 more
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 31 seconds
[INFO] Finished at: Wed May 06 16:35:54 CEST 2009
[INFO] Final Memory: 19M/34M
[INFO]
------------------------------------------------------------------------

John

unread,
May 6, 2009, 12:12:59 PM5/6/09
to tellurium-users
Seems to be Surefire problem, the root cause is as follows,

Caused by: java.lang.StringIndexOutOfBoundsException: String index out
of range: -1
at java.lang.String.substring(String.java:1938)
at
org.apache.maven.plugins.surefire.report.SurefireReportGenerator.getErrorLineNumber
(SurefireReportGenerator.java:638)

After we added the maven-jxr-plugin and report section to the Maven
archetypes, would you be able to run "mvn site" ?

Seems the source cross reference is created at that point.

Or try to run manually

mvn jxr:jxr
mvn jxr:test-jxr

Matt, do you have any input on this?

Thanks,

Jian

Jian Fang

unread,
May 6, 2009, 12:25:52 PM5/6/09
to tellurium-users
Tested. If you run

mvn jxr:jxr
mvn jxr:test-jxr

before

mvn surefire-report:report -Dtest=SomethingTestCase

The line number of error should be there.

Ernst

unread,
May 7, 2009, 8:53:38 AM5/7/09
to tellurium-users
As I wrote in the other thread "How to interpret problem reports", JXR
and Surefire both need access to the source code line to build their
reports, so this is just a sideeffect of that problem. So this case is
closed.

//Ernst

On May 6, 6:25 pm, Jian Fang <john.jian.f...@gmail.com> wrote:
> Tested. If you run
>
> mvn jxr:jxr
> mvn jxr:test-jxr
>
> before
>
> mvn surefire-report:report -Dtest=SomethingTestCase
>
> The line number of error should be there.
>
Reply all
Reply to author
Forward
0 new messages