junit.framework.AssertionFailedError: No tests fou

2019-02-24 23:23发布

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>

1条回答
女痞
2楼-- · 2019-02-25 00:22

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.

查看更多
登录 后发表回答