testNg之RetryListener

来源:互联网 发布:react.js 中文文档 编辑:程序博客网 时间:2024/06/05 11:22
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;


import org.testng.IAnnotationTransformer;
import org.testng.IRetryAnalyzer;
import org.testng.annotations.ITestAnnotation;


/**
 * RetryListener for each test method.
 * 
 * 
 */
public class RetryListener implements IAnnotationTransformer {


@SuppressWarnings("rawtypes")
public void transform(ITestAnnotation annotation, Class testClass, Constructor testConstructor, Method testMethod) {
IRetryAnalyzer retry = annotation.getRetryAnalyzer();
if (retry == null) {
annotation.setRetryAnalyzer(TestngRetry.class);
}
}


}
0 0
原创粉丝点击