junit version issues

75 views
Skip to first unread message

Jens Dietrich

unread,
Apr 9, 2017, 6:08:36 PM4/9/17
to EvoSuite
Hi, 

When running evosuite-generated tests from an ant script, tests fail with a verification error. This looks like a linkage - related problem. Please see below for the relevant part of the stacktrace. 

I think that this is a DELL-hell style problem caused by different versions of junit - the ant junit task is compiled against 4.12 (that has the wrapIfNotThreadSafe method), but the evosuite jar seems to have an older versions backed into it. My question is whether there is a particular reason for this, which version it is, and whether it could be safely removed and replaced by an external junit 4.12 dependency. 

Cheers, Jens


exercise.xml:307: java.lang.VerifyError: (class: org/junit/runner/notification/RunNotifier, method: wrapIfNotThreadSafe signature: (Lorg/junit/runner/notification/RunListener;)Lorg/junit/runner/notification/RunListener;) Wrong return type in function

at org.apache.tools.ant.taskdefs.optional.junit.CustomJUnit4TestAdapterCache.getNotifier(CustomJUnit4TestAdapterCache.java:56)

at org.apache.tools.ant.taskdefs.optional.junit.CustomJUnit4TestAdapterCache.getNotifier(CustomJUnit4TestAdapterCache.java:49)

at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:38)

at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:535)

at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeInVM(JUnitTask.java:1647)

at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java:1047)

at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeOrQueue(JUnitTask.java:2207)

at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java:858)

at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)


Gordon Fraser

unread,
Apr 17, 2017, 11:10:25 AM4/17/17
to Jens Dietrich, EvoSuite
Hi Jens,

The evosuite-standalone-runtime.jar file contains no JUnit, you should probably use that to execute your tests and add your own JUnit version on the classpath.

I don't know what exactly is causing your problem. Dealing with Ant and it's classloaders has always been difficult.

Best wishes,
Gordon



--
You received this message because you are subscribed to the Google Groups "EvoSuite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to evosuite+unsubscribe@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/evosuite/8b155243-f3fb-4d22-a7ae-38d2f51c019c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Devendra Reddy

unread,
Jun 29, 2020, 7:04:31 AM6/29/20
to EvoSuite
Can you tell me how u used evosuite with ANT for generating the test cases
Reply all
Reply to author
Forward
0 new messages