junit报错----java.lang.Exception: No tests found matching

java.lang.Exception: No tests found matching [{ExactMatcher:fDisplayName=testSelect], {ExactMatcher:fDisplayName=testSelect(com.vincent.test.UserDaoTest)], {LeadingIdentifierMatcher:fClassName=com.vincent.test.UserDaoTest,fLeadingIdentifier=testSelect]] from [email protected]
    at org.junit.internal.requests.FilterRequest.getRunner(FilterRequest.java:40)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createFilteredTest(JUnit4TestLoader.java:80)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:71)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:46)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:522)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206)

从网上找了很多方法,这里总结一下:

1.测试方法不能有返回值

2.测试方法不能设置为private

3.测试方法不能设置为static

4.没加@Test

5.与spring的版本不兼容(目前没遇到过)

原文地址:https://www.cnblogs.com/cjasonvincent/p/8728657.html

时间: 2024-10-26 02:04:21

junit报错----java.lang.Exception: No tests found matching的相关文章

junit报错java.lang.Exception: No tests found matching

junit报错java.lang.Exception: No tests found matching 最近在学习Spring的过程中用到了Junit,然而中间遇到了个令人十分捉狂的报错. 1 java.lang.Exception: No tests found matching [{ExactMatcher:fDisplayName=cdShouldNotBeNull], {ExactMatcher:fDisplayName=cdShouldNotBeNull(soundsystem.CDP

junit test 报错,java.lang.Exception: No tests found matching [{ExactMatcher:fDisplayName=esopCreateTest],

java.lang.Exception: No tests found matching [{ExactMatcher:fDisplayName=esopCreateTest], {ExactMatcher:fDisplayName=esopCreateTest(com.cmcc.open.ss.util.EsopSynWebServiceActionTest)], {LeadingIdentifierMatcher:fClassName=com.cmcc.open.ss.util.EsopSy

java.lang.Exception: No tests found matching Method deleteById(cn.bytestream.mongodb.MongoDB4CRUDTest)

java.lang.Exception: No tests found matching Method deleteById(cn.bytestream.mongodb.MongoDB4CRUDTest) from [email protected] at org.junit.internal.requests.FilterRequest.getRunner(FilterRequest.java:35) at org.eclipse.jdt.internal.junit4.runner.JUni

启动tomcat报错 java.lang.Exception: Socket bind failed

严重: Error initializing endpointjava.lang.Exception: Socket bind failed: [730048] ?????????×???(Э?é/???????/???)????í?? at org.apache.tomcat.util.net.AprEndpoint.init(AprEndpoint.java:647) at org.apache.coyote.http11.Http11AprProtocol.init(Http11AprPr

反射报错java.lang.IllegalArgumentException: wrong number of arguments

class Person{ private String name ; private String sex ; public Person(){ System.out.println("c"); } public Person(String c1){ this.name =c1; System.out.println("c1"+c1); } public Person(String c1,String c2){ this.name =c1; this.sex =c

Intellij IDEA 报错java.lang.NoClassDefFoundError

Intellij IDEA 报错java.lang.NoClassDefFoundError 11-Aug-2018 23:48:24.686 严重 [http-nio-8080-exec-5] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [com.wbg.testservlet] in context with path [] threw exception [Servle

maven web 项目中启动报错java.lang.ClassNotFoundException: org.springframework.web.util.Log4jConfigListener

本篇文章主要介绍了"maven web 项目中启动报错java.lang.ClassNotFoundException: org.springframework.web.util.Log4jConfigListener ",主要涉及到maven web 项目中启动报错java.lang.ClassNotFoundException: org.springframework.web.util.Log4jConfigListener 方面的内容,对于maven web 项目中启动报错jav

报错:java.lang.Long cannot be cast to java.lang.Integer

Long 无法转化成Integer类型. 这个异常 经常出现在hinbernate分页查询的时候. 原因: 这里在Hibernate2.0之前版本list.get(0)返回的是Integer类型. 但是在Hibernate3.0以后版本list.get(0)返回的是Long类型. 解决方法 public Integer getUsersCount() { String hql = "select count(*) from Users"; List list = super.pageQ

开着idea,死机了,关机重启。重启之后,重新打开idea报错java.lang.AssertionError:upexpected content storage modification

开着idea,死机了,关机重启.重启之后,重新打开idea报错java.lang.AssertionError:upexpected content storage modification. goole得到: If you cannot even open your project in IntelliJ: Close IntelliJ Go to the directory <your_home>/.IntelliJIdeaXX/system/cache where XX is your