今天JUnit测试的时候报错如下
java.lang.Exception: No tests found matching [{ExactMatcher:fDisplayName=testGetAllOrder], {ExactMatcher:fDisplayName=testGetAllOrder(com.leo.test.OrderMapperTest)], {LeadingIdentifierMatcher:fClassName=com.leo.test.OrderMapperTest,fLeadingIdentifier=testGetAllOrder]] from org.junit.internal.requests.ClassRequest@df8d8a
at org.junit.internal.requests.FilterRequest.getRunner(FilterRequest.java:37)
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:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
找了半天后发现,原来是因为我的是JUnit测试加了返回值,把返回值改成void就没问题了