关于java.lang.Exception:No tests found matching的一系列解决方法
问题描述:
java.lang.Exception: No tests found matching [{ExactMatcher:fDisplayName=yahaa], {ExactMatcher:fDisplayName=yahaa(dao.ClassDao)], {LeadingIdentifierMatcher:fClassName=dao.ClassDao,fLeadingIdentifier=yahaa]] from org.junit.internal.requests.ClassRequest@bebdb06
at org.junit.internal.requests.FilterRequest.getRunner(FilterRequest.java:40)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createFilteredTest(JUnit4TestLoader.java:77)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:68)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:43)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:444)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
问题分析与解决:
1、忘记在方法前加 @Test 注解了。
解决:加上就行。
2、IDE或者项目原因。
解决:重启eclipse/myeclipse。或者关闭项目再打开。
3、看你的测试类是否继承TestCase。
解决:删除此继承
4、测试类名字不规范,直接命名为‘Test’
解决:会和Junit的测试类相冲突,得把类名改了
5、(最容易忽视的)启动测试方法的方式不对。
例如:

如果鼠标放在上图的红色方框内右键选择了run as——Junt Test 那么就会发生找不到“No tests found matching ”这个错误。
并且在蓝色区域以外的地方run as的话那么就是跑整个类的所有的测试方法
关于java.lang.Exception:No tests found matching的一系列解决方法的更多相关文章
- java.lang.Exception: No tests found matching [{ExactMatcher:fDisplayName=test]解决办法
在进行简单的Junit单元测试时,测试一直报错: 先来看一下我的单元测试类: import org.junit.Test; import org.junit.runner.RunWith; impor ...
- java.lang.Exception: No tests found matching Method tes(com.bw.test.Testrefiect) from org.junit.vintage.engine.descriptor.RunnerRequest@3bfdc050 at org.junit.internal.requests.FilterRequest.getRunner
junit 方法 没有加上注解 @Test java.lang.Exception: No tests found matching Method tes(com.bw.test.Testre ...
- 谈一谈JUnit神奇的报错 java.lang.Exception:No tests found matching
最近在学习Spring+SpringMVC+MyBatis,一个人的挖掘过程确实有点艰难,尤其是有一些神奇的报错让你会很蛋疼.特别是接触一些框架还是最新版本的时候,会因为版本问题出现很多错误,欢迎大家 ...
- 测试--错误java.lang.Exception: No tests found matching [{ExactMatcher:fDisplayName=select], {ExactMatcher:fDisplayName=select(com.rjj.demo.DemoApplicationTests)]...
异常这个错误java.lang.Exception: No tests found matching [{ExactMatcher:fDisplayName=select], {ExactMatche ...
- junit test 报错,java.lang.Exception: No tests found matching [{ExactMatcher:fDisplayName=esopCreateTest],
java.lang.Exception: No tests found matching [{ExactMatcher:fDisplayName=esopCreateTest], {ExactMatc ...
- java.lang.Exception: No tests found matching [{ExactMatcher:fDisplayName=testSelect], {ExactMatcher:fDisplayName=testSelect(cool.zsn.Dao.UserMapperTest)], {LeadingIdentifierMatcher:fClassName=cool.zsn
@Before:每次调用类中的方法,都会先执行@Before下的方法 @Before下的方法应该是 public : @Before public void init() { application ...
- java.lang.Exception: No tests found matching(Junit测试异常)
java.lang.Exception: No tests found matching [{ExactMatcher:fDisplayName=save], {ExactMatcher:fDispl ...
- 错误:java.lang.Exception: No tests found matching Method testPrePage1(egou_manager_web.TestEBrand) from org.junit.internal.requests.ClassRequest@4f3cc73c
今天测试分页时出现以下错误: java.lang.Exception: No tests found matching Method testPrePage1(egou_manager_web.Tes ...
- java.lang.Exception: No tests found matching
java.lang.Exception: No tests found matching 需要导入junit.jar 和 hamcrest.jar
随机推荐
- 【云安全与同态加密_调研分析(5)】云安全标准现状与统计——By Me
- python学习笔记(二十三)私有方法和私有属性
在Class内部,可以有属性和方法,而外部代码可以通过直接调用实例变量的方法来操作数据,这样,就隐藏了内部的复杂逻辑. 但是,从前面Person类的定义来看,外部代码还是可以自由地修改一个实例的nam ...
- JS通过身份证号获取生日、年龄、性别
<script> function IdCard(UUserCard,num){ if(num==1){ //获取出生日期 birth=UUserCard.substring(6, 10) ...
- python3 爬虫神器pyquery的使用实例之爬网站图片
PyQuery 可让你用 jQuery 的语法来对 xml 进行操作,这和 jQuery 十分类似.如果利用 lxml,pyquery 对 xml 和 html 的处理将更快. 如果对 jQuery ...
- json & pickle数据序列化
序列化:把内存中的数据对象变成字符串 info = { 'name':'tom', 'age':22 } f = open("test.txt","w") f. ...
- JQuery可以轻松实现数字框
如果使用JQuery,则可以轻松实现数字框. <input type="text" name="name" value="0" run ...
- php 通过http user-agent判断是否为手机浏览器
<?php/*** 判断是否是通过手机访问* @return bool 是否是移动设备 */public function isMobile() { //判断手机发送的客户端标志 if ...
- Linux系统——NFS网络文件系统
在企业集群架构的工作场景中,NFS网络文件系统一般被用来存储共享视频,图片,附件等静态资源文件,通常网站用户上传的文件都会放到NFS共享里,然后前端所有的节点访问这些静态资源时都会读取NFS存储上的资 ...
- Spark SQL慕课网日志分析(1)--系列软件(单机)安装配置使用
来源: 慕课网 Spark SQL慕课网日志分析_大数据实战 目标: spark系列软件的伪分布式的安装.配置.编译 spark的使用 系统: mac 10.13.3 /ubuntu 16.06,两个 ...
- Winter-2-STL-F Ananagrams 解题报告及测试数据
Time Limit:3000MS Memory Limit:0KB Description Most crossword puzzle fans are used to anagrams- ...