错误:
java.lang.Exception: No tests found matching [{ExactMatcher:fDisplayName=testAdd], {ExactMatcher:fDisplayName=testAdd(cn.itcast.TestTbTest)], {LeadingIdentifierMatcher:fClassName=cn.itcast.TestTbTest,fLeadingIdentifier=testAdd]] from org.junit.internal.requests.ClassRequest@27082746
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)方法被写成private,正确应为public
@Test
private void testAdd() throws Exception ....
(2)