JUnit testing got initializationError with java.lang.Exception: No tests found matching

后端 未结 8 1525
别那么骄傲
别那么骄傲 2021-01-01 18:59

When running JUnit testing , it gave an initializationError: No tests found matching. Like this:

prodapi-main-junit
initializationError(org.junit.runner.man         


        
8条回答
  •  甜味超标
    2021-01-01 19:42

    I had to add the hamcrest-all-1.3.jar into classpath to run unit test.

    junit 4.12

    java.lang.Exception: No tests found matching [{ExactMatcher:fDisplayName=myTest], {ExactMatcher:fDisplayName=scannerTest(example.JavaTest)], {LeadingIdentifierMatcher:fClassName=example.JavaTest,fLeadingIdentifier=myTest]] from org.junit.internal.requests.ClassRequest@38af3868
        at org.junit.internal.requests.FilterRequest.getRunner(FilterRequest.java:40)
    

提交回复
热议问题