关于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
随机推荐
- JQuery能够高效地操作页面元素
关于DOM和CSS的页面元素选择: $("span"); //全部span元素 $("#elem"); //id为elem的元素 $(".c ...
- HDU3123:GCC(同余模简单题)
题目:http://acm.hdu.edu.cn/showproblem.php?pid=3123 题意很简单,就是同余模的简单应用. 代码如下: #include <iostream> ...
- Java中的反射[转载]
转自:https://blog.csdn.net/sinat_38259539/article/details/71799078#commentBox 1.什么是反射? 反射是通过一个类可以知道其中所 ...
- Linux文件权限分析
一.用户组概念 在linux系统中,每个用户必属于一个组,不能独立于组之外.每个文件都有所有者,所在组和其他组这三个概念. (1)所有者:一般为文件的创建者,谁创建了该文件,就成为了该文件的所有者, ...
- Mysql binlog 安全删除(转载)
简介: 如果你的 Mysql 搭建了主从同步 , 或者数据库开启了 log-bin 日志 , 那么随着时间的推移 , 你的数据库 data 目录下会产生大量的日志文件 shell > ll /u ...
- nginx的access_log与error_log(三)
本篇介绍一下在nginx服务器的的两种日志的查看. 根据你找出来的地址,尽心vi编辑,进入nginx.conf文件进行查找路径 从而找到,我机子的两个日志存放地点: /var/logdat ...
- Font: a C++ class
Font: a C++ class This class is used in Fractal Generator. Avi Examples The header fileFon ...
- Check back what the kd 6 for more info
Representing a shout-to his fans in China, the What the KD 6 may be the product of NIKEiD's Player E ...
- ajax示例
ajax(Asynchronous Javascript And XML)翻译成中文就是异步的javascript和XML,即用javascript语言与服务器进行异步交互,传输的数据为XML(当然, ...
- spl_autoload_register(转载 http://blog.csdn.net/panpan639944806/article/details/23192267)
在了解这个函数之前先来看另一个函数:__autoload. 一.__autoload 这是一个自动加载函数,在PHP5中,当我们实例化一个未定义的类时,就会触发此函数.看下面例子: printit.c ...