maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kristian Nordal <kristian.nor...@gmail.com>
Subject Re: Problems when running unit tests with m2
Date Sun, 08 Jan 2006 20:04:32 GMT
On Jan 8, 2006, at 6:56 PM, Kristian Nordal wrote:

> Hi,
>
> I'm getting this when I run "mvn test" (or "clean test" / "clean  
> install"):
>
> [DEBUG] Test Classpath :
> [DEBUG] /Users/kristian/hisp/scm/trunk/dhis-2/dhis-support/dhis- 
> support-hibernate/target/test-classes
> [DEBUG] /Users/kristian/hisp/scm/trunk/dhis-2/dhis-support/dhis- 
> support-hibernate/target/classes
> [DEBUG] /Users/kristian/hisp/scm/trunk/dhis-2/dhis-support/dhis- 
> support-hibernate/target/classes
> [DEBUG] /Users/kristian/hisp/scm/trunk/dhis-2/dhis-support/dhis- 
> support-hibernate/target/test-classes
> [DEBUG] /Users/kristian/hisp/scm/trunk/dhis-2/dhis-api/target/classes
> [DEBUG] /Users/kristian/.m2/repository/xerces/xerces/2.4.0/ 
> xerces-2.4.0.jar
> [DEBUG] /Users/kristian/.m2/repository/org/hibernate/hibernate/ 
> 3.0.5/hibernate-3.0.5.jar
> [DEBUG] /Users/kristian/.m2/repository/junit/junit/3.7/junit-3.7.jar
> [DEBUG] /Users/kristian/.m2/repository/commons-logging/commons- 
> logging/1.0.4/commons-logging-1.0.4.jar
> [DEBUG] /Users/kristian/.m2/repository/cglib/cglib/2.0.2/ 
> cglib-2.0.2.jar
> [DEBUG] /Users/kristian/.m2/repository/asm/asm/1.4.3/asm-1.4.3.jar
> [DEBUG] /Users/kristian/.m2/repository/xalan/xalan/2.7.0/ 
> xalan-2.7.0.jar
> [DEBUG] /Users/kristian/.m2/repository/ehcache/ehcache/1.1/ 
> ehcache-1.1.jar
> [DEBUG] /Users/kristian/.m2/repository/logkit/logkit/1.0.1/ 
> logkit-1.0.1.jar
> [DEBUG] /Users/kristian/.m2/repository/commons-collections/commons- 
> collections/2.1.1/commons-collections-2.1.1.jar
> [DEBUG] /Users/kristian/.m2/repository/avalon-framework/avalon- 
> framework/4.1.3/avalon-framework-4.1.3.jar
> [DEBUG] /Users/kristian/.m2/repository/springframework/spring/1.2.4/ 
> spring-1.2.4.jar
> [DEBUG] /Users/kristian/.m2/repository/hsqldb/hsqldb/1.7.3.3/ 
> hsqldb-1.7.3.3.jar
> [DEBUG] /Users/kristian/.m2/repository/log4j/log4j/1.2.6/ 
> log4j-1.2.6.jar
> [DEBUG] /Users/kristian/hisp/scm/trunk/dhis-2/dhis-support/dhis- 
> support-test/target/classes
> [DEBUG] /Users/kristian/.m2/repository/xml-apis/xml-apis/2.0.2/xml- 
> apis-2.0.2.jar
> [DEBUG] /Users/kristian/.m2/repository/hibernate/antlr/2.7.5H3/ 
> antlr-2.7.5H3.jar
> [DEBUG] /Users/kristian/.m2/repository/dom4j/dom4j/1.4/dom4j-1.4.jar
> [DEBUG] /Users/kristian/.m2/repository/geronimo-spec/geronimo-spec- 
> jta/1.0-M1/geronimo-spec-jta-1.0-M1.jar
> [DEBUG] /Users/kristian/.m2/repository/antlr/antlr/2.7.2/ 
> antlr-2.7.2.jar
> [DEBUG] Adding to surefire test classpath: /Users/kristian/.m2/ 
> repository/junit/junit/3.8.1/junit-3.8.1.jar
> [DEBUG] Adding to surefire test classpath: /Users/kristian/.m2/ 
> repository/org/apache/maven/surefire/surefire-booter/1.5/surefire- 
> booter-1.5.jar
> [DEBUG] Adding to surefire test classpath: /Users/kristian/.m2/ 
> repository/org/apache/maven/surefire/surefire/1.5.1/surefire-1.5.1.jar
> [DEBUG] Adding to surefire test classpath: /Users/kristian/m2/core/ 
> plexus-utils-1.0.5.jar
> [INFO]  
> ---------------------------------------------------------------------- 
> ------
> [ERROR] BUILD ERROR
> [INFO]  
> ---------------------------------------------------------------------- 
> ------
> [INFO] Error executing surefire
>
> tried to access method junit.framework.TestCase.<init>()V from  
> class org.apache.maven.surefire.battery.assertion.BatteryAssert
> [INFO]  
> ---------------------------------------------------------------------- 
> ------
> [INFO] Trace
> org.apache.maven.lifecycle.LifecycleExecutionException: Error  
> executing surefire
>         at  
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals 
> (DefaultLifecycleExecutor.java:555)
>         at  
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLif 
> ecycle(DefaultLifecycleExecutor.java:472)
>         at  
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal 
> (DefaultLifecycleExecutor.java:451)
>         at  
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHand 
> leFailures(DefaultLifecycleExecutor.java:303)
>         at  
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegment 
> s(DefaultLifecycleExecutor.java:270)
>         at  
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute 
> (DefaultLifecycleExecutor.java:139)
>         at org.apache.maven.DefaultMaven.doExecute 
> (DefaultMaven.java:322)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java: 
> 115)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
>         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:324)
>         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: Error  
> executing surefire
>         at org.apache.maven.test.SurefirePlugin.execute 
> (SurefirePlugin.java:371)
>         at org.apache.maven.plugin.DefaultPluginManager.executeMojo 
> (DefaultPluginManager.java:432)
>         at  
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals 
> (DefaultLifecycleExecutor.java:530)
>         ... 16 more
> Caused by: java.lang.reflect.InvocationTargetException
>         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:324)
>         at  
> org.apache.maven.surefire.SurefireBooter.runTestsInProcess 
> (SurefireBooter.java:246)
>         at org.apache.maven.surefire.SurefireBooter.run 
> (SurefireBooter.java:195)
>         at org.apache.maven.test.SurefirePlugin.execute 
> (SurefirePlugin.java:366)
>         ... 18 more
> Caused by: java.lang.reflect.InvocationTargetException
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0 
> (Native Method)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance 
> (NativeConstructorAccessorImpl.java:39)
>         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance 
> (DelegatingConstructorAccessorImpl.java:27)
>         at java.lang.reflect.Constructor.newInstance 
> (Constructor.java:274)
>         at org.apache.maven.surefire.Surefire.instantiateBatteries 
> (Surefire.java:302)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:96)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:90)
>         ... 25 more
> Caused by: java.lang.IllegalAccessError: tried to access method  
> junit.framework.TestCase.<init>()V from class  
> org.apache.maven.surefire.battery.assertion.BatteryAssert
>         at  
> org.apache.maven.surefire.battery.assertion.BatteryAssert.<init> 
> (BatteryAssert.java:23)
>         at org.apache.maven.surefire.battery.AbstractBattery.<init> 
> (AbstractBattery.java:31)
>         at org.apache.maven.surefire.battery.DirectoryBattery.<init> 
> (DirectoryBattery.java:39)
>         ... 32 more
>
> Anyone have any idea about this?
>
> I'm running maven 2.0.1

Seems like a dependency pulled down an older version of JUnit (3.7),  
while I'm using 3.8.1. Not sure, but after overriding the junit  
version it works.

--
Kristian

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message