junit的错误 No tests found matching [{ExactMatcher:fDisplayName=test2],
来源:互联网 发布:linux解压gz文件命令 编辑:程序博客网 时间:2024/06/05 05:00
在使用junit的时候如果一个测试的函数为private的时候 会出现下面问题:
java.lang.Exception: No tests found matching [{ExactMatcher:fDisplayName=test2], {ExactMatcher:fDisplayName=test2(web27.jedis.JedisTest)], {LeadingIdentifierMatcher:fClassName=web27.jedis.JedisTest,fLeadingIdentifier=test2]] from org.junit.internal.requests.ClassRequest@2d38eb89
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)
如果类中有多个注解@Test,其中有一个方式不小心写成private时候 会出现上面错误。
解决办法:
@Test
private void test2() {
}
把private 修改成public 即可:
@Test
public void test2() {
}
- junit的错误 No tests found matching [{ExactMatcher:fDisplayName=test2],
- No tests found matching [{ExactMatcher:fDisplayName=dataSourceTest]........错误解决方法
- no tests found matching[{ExactMatcher:fDisplayName=testSave}]
- No tests found matching [{ExactMatcher:fDisplayName=getClassesTest], {ExactMatcher:fDisplayName=get
- java.lang.Exception: No tests found matching [{ExactMatcher:fDisplayName=findAll], {ExactMatcher:fDi
- java.lang.Exception: No tests found matching [{ExactMatcher:fDisplayName=findAll], {ExactMatcher:fDi
- 使用jutil测试程序出现错误java.lang.Exception: No tests found matching [{ExactMatcher:fDisplayName=classestest]
- java.lang.Exception: No tests found matching [{ExactMatcher:fDisplayName=testDemo]出现原因及解决办法
- java.lang.Exception: No tests found matching [{ExactMatcher:fDisplayName=getSession]
- No tests found matching 【junit 异常】
- junit异常(No tests found matching)
- 使用junit4报“no Junit tests found”的错误
- JUnit:java.lang.Exception: No tests found matching Method ***
- Junit报错:java.lang.Exception: No tests found matching
- Junit测试问题:java.lang.Exception: No tests found matching
- no junit tests found
- 谈一谈JPA遇到的:JUnit神奇的报错 java.lang.Exception:No tests found matching
- 谈一谈JUnit神奇的报错 java.lang.Exception:No tests found matching
- AES加密解密
- Java学习笔记---反射
- Android-times-square自定义样式
- Python-时间处理
- 如何免费使用webstorm
- junit的错误 No tests found matching [{ExactMatcher:fDisplayName=test2],
- RMI远程服务操作
- Jsonp实现跨域详解
- js Date 获取 年 月 日 具体的值
- java web中servlet实现post方法上传多文件数据接收
- 用vue,如何给一个列表中的每个元素标签绑定id
- Kafka 配置使用注意事项
- 刷清橙OJ--A1052.数的读法
- 搭建和配置支撑2000人同时观看的流媒体服务器系统(Linux步骤详解)