finding the current test method


테스트 메서드 하나가 끝나지 않고 계속 도는 듯 하다. 어떤 클래스의 어떤 메서드인지 다음과 같이 리스너를 하나 만들어서 사용했다.

public class InvokedMethodListener implements IInvokedMethodListener {

    @Override
    public void beforeInvocation(final IInvokedMethod method,
                                 final ITestResult result) {
        logger.debug("beforeInvocation({}, {})", method, result);
    }

    @Override
    public void afterInvocation(final IInvokedMethod method,
                                final ITestResult result) {
        // not interested
    }
}
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-surefire-plugin</artifactId>
  <configuration>
    <properties>
      <property>
        <name>listeners</name>
        <value>package.to.the.InvokedMethodListener</value>
      </property>
    </properties>
  </configuration>
</plugin>
HH.mm.ss.SSS [main] DEBUG package.to.the.InvokedMethodListener - beforeInvocation(...)
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s