关于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
随机推荐
- mdf, ldf文件导入到sql server 2005的方法
mdf, ldf文件导入到sql server 2005的方法 在实际的工作中, 有很多涉及到数据库资料的备份,转移, 恢复等方面的工作, 但是并不是所有的资料都是以.bak格式存在的, 比如说, 你 ...
- 18.让sublime text3支持Vue语法高亮显示
1.准备语法高亮插件vue-syntax-highlight. 下载地址: https://github.com/vuejs/vue-syntax-highlight 下载页面并下载: 解开压缩包vu ...
- java 多线程 day10 获取线程的返回值 CallableAndFuture
import java.util.Random;import java.util.concurrent.*; /** * Created by chengtao on 17/12/4. * * 获取线 ...
- Servlet实现前后端交互的原理及过程解析
在日常调试项目时,总是利用tomcat去启动项目,并进行前后端联调,但对于前后端的请求响应的交互原理及过程并不是特别清晰. 为什么在前端发出相应请求,就能跳转到后端通过程序得到结果再响应到前端页面呢? ...
- 生信-RPKM与FPKM学习[转载]
转自:https://baike.baidu.com/item/RPKM/1197657 均反应基因的表达水平 1.RPKM的计算公式 分母是总共比对到这个基因的reads的数目(条 为单位),分母是 ...
- 20165324《Java程序设计》第二周
20165324 <Java程序设计>第2周学习总结 教材学习内容总结 本周学习内容如下: 基本数据类型 整数类型:byte,shout,int,long. 字符类型:char. 浮点类型 ...
- 百度NLP一面
C++ : 1.拷贝构造函数和重载=符分别在什么情况下被调用,实现有什么区别 2.虚函数的目的,虚函数和模板类的区别,如何找到虚函数 常规算法: 1. 如何输出一个集合的所有真子集,递归和非递 ...
- mysql时间戳转换成可读时间格式
代码: SELECT FROM_UNIXTIME(1234567890, '%Y-%m-%d %H:%i:%S') 附:在mysql中,一个时间字段的存储类型是int(11),怎么转化成字符类型,比方 ...
- Spark --【宽依赖和窄依赖】
前言 Spark中RDD的高效与DAG图有着莫大的关系,在DAG调度中需要对计算过程划分stage,暴力的理解就是stage的划分是按照有没有涉及到shuffle来划分的,没涉及的shuffle的都划 ...
- python3 使用opencv 画基本图形
在Python3 环境下安装opencv-python 后练习画基本图形: import numpy as np import cv2 # BGR format GREEN = (0, 255, 0) ...