maven-surefire-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ernst Persson <ern...@gmail.com>
Subject Unknown source for assertion in surefire driven JUnit test with Tellurium
Date Fri, 08 May 2009 10:54:56 GMT
Hi,

I've started looking at the Tellurium web testing framework. I'm using
their template with Maven, Surefire and JUnit to drive the tests. It's
very easy to test it, just follow this guide.
http://code.google.com/p/aost/wiki/TenMinutesToTellurium

What happens is that when I have an assertion failure the JVM (?)
doesn't provide the source file and line number! See stacktrace (1)
This leads to a number of issues, i.e. you can't build reports. See
stacktrace (2)

I can't see that anything Tellurium-specific goes on here and neither
can the Tellurium maintainer.
Does anyone have a clue what might be causing this?

Using surefire 2.4.3.

Regards
/Ernst Persson

(1)
more target/surefire-reports/test.SomethingTestCase.txt
-------------------------------------------------------------------------------
Test set: test.SomethingTestCase
-------------------------------------------------------------------------------
Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 18.251
sec <<< FAILURE!
testDuplicateName(test.SomethingTestCase)  Time elapsed: 2.231 sec  <<< FAILURE!
java.lang.AssertionError: expected not same
	at org.junit.Assert.fail(Assert.java:74)
	at org.junit.Assert.failSame(Assert.java:437)
	at org.junit.Assert.assertNotSame(Assert.java:420)
	at org.junit.Assert.assertNotSame(Assert.java:430)
>>>> at test.SomethingTestCase.testDuplicateName(Unknown Source)
	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.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
	at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98)
	at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)
	at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87)
	at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
	at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
	at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
	at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
	at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
	at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
	at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
	at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
	at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
	at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
	at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
	at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
	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.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
	at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)

(2)
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] String index out of range: -1
[INFO] ------------------------------------------------------------------------
[INFO] Trace
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:600)
	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.plugins.site.ReportDocumentRenderer.renderDocument(ReportDocumentRenderer.java:139)
	at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.renderModule(DefaultSiteRenderer.java:269)
	at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.render(DefaultSiteRenderer.java:101)
	at org.apache.maven.plugins.site.SiteMojo.renderLocale(SiteMojo.java:133)
	at org.apache.maven.plugins.site.SiteMojo.execute(SiteMojo.java:100)
	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
	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)

PS I hope I'm not upsetting anyone by crossposting this, I really have
no idea where the problem is.

Mime
View raw message