开发者

junit.framework.AssertionFailedError: No tests found in xyz package

开发者 https://www.devze.com 2023-04-06 09:39 出处:网络
I am getting this error when I try to run Junits from ANT task. using eclipse launcher 开发者_如何学Goit works fine. Version of junit is 4.9 and ANT version is 1.7

I am getting this error when I try to run Junits from ANT task. using eclipse launcher 开发者_如何学Goit 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 and ant-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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号