1package test.annotationtransformer; 2 3import org.testng.IAnnotationTransformer2; 4import org.testng.annotations.IConfigurationAnnotation; 5import org.testng.annotations.IDataProviderAnnotation; 6import org.testng.annotations.IFactoryAnnotation; 7import org.testng.annotations.ITestAnnotation; 8 9import java.lang.reflect.Constructor; 10import java.lang.reflect.Method; 11 12public class DataProviderTransformer implements IAnnotationTransformer2 { 13 14 @Override 15 public void transform(IConfigurationAnnotation annotation, Class testClass, 16 Constructor testConstructor, Method testMethod) 17 { 18 } 19 20 @Override 21 public void transform(IDataProviderAnnotation annotation, Method testMethod) { 22 annotation.setName("dataProvider"); 23 } 24 25 @Override 26 public void transform(ITestAnnotation annotation, Class testClass, 27 Constructor testConstructor, Method testMethod) 28 { 29 } 30 31 @Override 32 public void transform(IFactoryAnnotation annotation, Method testMethod) { 33 } 34} 35