没有测试发现与测试运动员'JUnit 4' [英] No tests found with test runner 'JUnit 4'

查看:311
本文介绍了没有测试发现与测试运动员'JUnit 4'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Java测试在Eclipse中运行良好。但现在,当我从运行菜单重新启动测试时,我会收到以下消息:

 没有测试发现与测试运行器'JUnit 4'

.classpath 文件中拥有所有 jar 文件,最后有:

  classpathentry exports =truekind =conpath =org.eclipse.jdt.junit.JUNIT_CONTAINER / 4/> 
< classpathentry kind =outputpath =bin/>
< / classpath>

如何解决此错误并重新运行测试?

解决方案

这刚刚发生在我身上。重新建立或重新启动Eclipse没有帮助。



我通过重命名一个测试方法来解决它,从test ...(JUnit3样式)开始,然后<强>全部测试。我将其重命名为以前的内容,它仍然可以工作。


My Java test worked well from Eclipse. But now, when I relaunch test from the run menu, I get the following message:

No tests found with test runner 'JUnit 4'

In the .classpath file I have all jar files, and at the end have:

<classpathentry exported="true" kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
    <classpathentry kind="output" path="bin"/>
</classpath>

How can I resolve this error and get tests running again?

解决方案

this just happened to me. Rebuilding or restarting Eclipse didn't help.

I solved it by renaming one of the test methods to start with "test..." (JUnit3 style) and then all tests are found. I renamed it back to what it was previously, and it still works.

这篇关于没有测试发现与测试运动员'JUnit 4'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆