I am getting this error when I try to run Junits from ANT task. using eclipse launcher it works fine. Version of junit is 4.9 and ANT version is 1.7 Surprisingly its giving "junit.framework.AssertionFailedError" which was package structure in JUNIT 3., in 4 it has changed to org.junit. I cross checked all libs and there is NO reference of junit 3.* version --and its working anyway using eclipse launcher. Any clue? Let me know if more detail is needed. Ant task is as follows
<target name="test">
<junit fork="yes" haltonfailure="yes">
<test name="${test.class.name}" />
<formatter type="plain" usefile="false" />
<classpath refid="junittest.classpath" />
</junit>
</target>
You should check, which
junit.jar
andant-junit.jar
ant is trying to use and make sure, they are for JUnit 4. Take a look at http://ant.apache.org/manual/Tasks/junit.html for the best place to put them.