How to print current executing JUnit test method while running all tests in a class or suite using ANT?

前端 未结 6 1365
野性不改
野性不改 2021-01-20 10:24

I have a set of JUnit Test Cases and I execute them from ANT using the junit task. While executing the tests, in the console I get to see only which test case (i.e. Java cla

6条回答
  •  温柔的废话
    2021-01-20 10:56

    Derive a class from RunListener and override the testStarted() method. It receives a Description parameter from which you can obtain the test class and the test method -- e.g., description.getMethodName().

提交回复
热议问题