junit: no tests found

后端 未结 11 878
情书的邮戳
情书的邮戳 2020-12-14 05:47

I have inherited a Java project and am new to Java development. I feel a good way for me to get comfortable with the code is to write some tests around it. I\'m writing my c

11条回答
  •  独厮守ぢ
    2020-12-14 05:54

    In my case, I needed junit4-version.jar in the classpath of the task junit and also:

    ant-version.jar
    ant-junit-version.jar
    ant-junit4-version.jar
    

    at the library of my ant installation (/usr/share/ant/lib).

    I was getting the error "junit.framework.AssertionFailedError: No tests found in ..." while I hadn't had ant-junit4-*version*.jar in the right place.

    I corrected this by installing ant-optional debian/ubuntu package:

    apt-get install ant-optional
    

提交回复
热议问题