junit 测试 spring-mybatis 报的奇葩异常

测试datasource: junit绿色通过,没毛病。

测试sessionfactory报如下错误:

 java.lang.Exception: No tests found matching [{ExactMatcher:fDisplayName=testSqlSessionFactory], {ExactMatcher:fDisplayName=testSqlSessionFactory(test.MyBatisTest)], {LeadingIdentifierMatcher:fClassName=test.MyBatisTest,fLeadingIdentifier=testSqlSessionFactory]] from org.junit.internal.requests.ClassRequest@19ebb3d
    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个回答

你写注解没@test。代码看一下啊

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问