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 FactoryTransformer 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  }
23
24  @Override
25  public void transform(ITestAnnotation annotation, Class testClass,
26      Constructor testConstructor, Method testMethod)
27  {
28  }
29
30  @Override
31  public void transform(IFactoryAnnotation annotation, Method testMethod) {
32    annotation.setDataProvider("dataProvider");
33  }
34}
35