JUnit4: java.lang.Exception: No tests found matching

java.lang.Exception: No tests found matching [{ExactMatcher:fDisplayName=testCon2],
{ExactMatcher:fDisplayName=testCon2(com._520it.spring.day1.container.ContainerTest)],
{LeadingIdentifierMatcher:fClassName=com._520it.spring.day1.container.ContainerTest,fLeadingIdentifier=testCon2]]
from org.junit.internal.requests.ClassRequest@6af9fcb2
     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)

原因:

       在JUnit4下,没有写  @Test        所以无法找到test  

 

你可能感兴趣的:(bug)