listeners.RetryListener Maven / Gradle / Ivy
The newest version!
package com.oyo.listeners;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import org.testng.IAnnotationTransformer;
import org.testng.IRetryAnalyzer;
import org.testng.annotations.ITestAnnotation;
/**
* @author manish.kumar
*
*/
public class RetryListener implements IAnnotationTransformer {
/* (non-Javadoc)
* @see org.testng.IAnnotationTransformer#transform(org.testng.annotations.ITestAnnotation, java.lang.Class, java.lang.reflect.Constructor, java.lang.reflect.Method)
*/
@Override
public void transform(ITestAnnotation testannotation, Class testClass, Constructor testConstructor, Method testMethod) {
IRetryAnalyzer retry = testannotation.getRetryAnalyzer();
if (retry == null) {
testannotation.setRetryAnalyzer(Retry.class);
}
}
}