Home | History | Annotate | Download | only in annotationtransformer
      1 package test.annotationtransformer;
      2 
      3 import org.testng.IAnnotationTransformer3;
      4 import org.testng.annotations.IConfigurationAnnotation;
      5 import org.testng.annotations.IDataProviderAnnotation;
      6 import org.testng.annotations.IFactoryAnnotation;
      7 import org.testng.annotations.IListenersAnnotation;
      8 import org.testng.annotations.ITestAnnotation;
      9 
     10 import java.lang.reflect.Constructor;
     11 import java.lang.reflect.Method;
     12 
     13 public class MyListenerTransformer implements IAnnotationTransformer3 {
     14 
     15   @Override
     16   public void transform(IListenersAnnotation annotation, Class testClass) {
     17     annotation.setValue(new Class[]{MySuiteListener2.class});
     18   }
     19 
     20   @Override
     21   public void transform(IConfigurationAnnotation annotation, Class testClass,
     22                         Constructor testConstructor, Method testMethod) {}
     23 
     24   @Override
     25   public void transform(IDataProviderAnnotation annotation, Method method) {}
     26 
     27   @Override
     28   public void transform(IFactoryAnnotation annotation, Method method) {}
     29 
     30   @Override
     31   public void transform(ITestAnnotation annotation, Class testClass, Constructor testConstructor,
     32                         Method testMethod) {}
     33 }
     34