Top Methods
org.testng

public Interface IAnnotationTransformer

extends ITestNGListener
Known Direct Subinterfaces
org.testng.internal.annotations.IAnnotationTransformer
Known Direct Implementers
org.testng.internal.annotations.DefaultAnnotationTransformer
Imports
java.lang.reflect.Constructor, .Method, org.testng.annotations.IConfigurationAnnotation, .IDataProviderAnnotation, .IFactoryAnnotation, .IListenersAnnotation, .ITestAnnotation

Method Summary

Modifier and TypeMethod and Description
public default void
transform(ITestAnnotation
The annotation that was read from your test class.
annotation
,
Class<T>
If the annotation was found on a class, this parameter represents this class (null otherwise).
testClass
,
Constructor<T>
If the annotation was found on a constructor, this parameter represents this constructor (null otherwise).
testConstructor
,
Method
If the annotation was found on a method, this parameter represents this method (null otherwise).
testMethod
)

This method will be invoked by TestNG to give you a chance to modify a TestNG annotation read from your test classes.

public default void
transform(IConfigurationAnnotation
The annotation that was read from your test class.
annotation
,
Class<T>
If the annotation was found on a class, this parameter represents this class (null otherwise).
testClass
,
Constructor<T>
If the annotation was found on a constructor, this parameter represents this constructor (null otherwise).
testConstructor
,
Method
If the annotation was found on a method, this parameter represents this method (null otherwise).
testMethod
)

Transform an IConfiguration annotation.

public default void
transform(IDataProviderAnnotation
The @DataProvider annotation
annotation
,
Method
The method annotated with the IDataProvider annotation.
method
)

Transform an IDataProvider annotation.

public default void
transform(IFactoryAnnotation
The annotation factory
annotation
,
Method
The method annotated with the IFactory annotation.
method
)

Transform an IFactory annotation.

public default void
transform(IListenersAnnotation annotation, Class<?> testClass)

Inherited from org.testng.ITestNGListener:
isEnabled

Method Detail

transformback to summary
public default void transform(ITestAnnotation annotation, Class<T> testClass, Constructor<T> testConstructor, Method testMethod)

This method will be invoked by TestNG to give you a chance to modify a TestNG annotation read from your test classes. You can change the values you need by calling any of the setters on the ITest interface.

Note that only one of the three parameters testClass, testConstructor and testMethod will be non-null.

Parameters
annotation:ITestAnnotation

The annotation that was read from your test class.

testClass:Class<T>

If the annotation was found on a class, this parameter represents this class (null otherwise).

testConstructor:Constructor<T>

If the annotation was found on a constructor, this parameter represents this constructor (null otherwise).

testMethod:Method

If the annotation was found on a method, this parameter represents this method (null otherwise).

transformback to summary
public default void transform(IConfigurationAnnotation annotation, Class<T> testClass, Constructor<T> testConstructor, Method testMethod)

Transform an IConfiguration annotation.

Note that only one of the three parameters testClass, testConstructor and testMethod will be non-null.

Parameters
annotation:IConfigurationAnnotation

The annotation that was read from your test class.

testClass:Class<T>

If the annotation was found on a class, this parameter represents this class (null otherwise).

testConstructor:Constructor<T>

If the annotation was found on a constructor, this parameter represents this constructor (null otherwise).

testMethod:Method

If the annotation was found on a method, this parameter represents this method (null otherwise).

transformback to summary
public default void transform(IDataProviderAnnotation annotation, Method method)

Transform an IDataProvider annotation.

Parameters
annotation:IDataProviderAnnotation

The @DataProvider annotation

method:Method

The method annotated with the IDataProvider annotation.

transformback to summary
public default void transform(IFactoryAnnotation annotation, Method method)

Transform an IFactory annotation.

Parameters
annotation:IFactoryAnnotation

The annotation factory

method:Method

The method annotated with the IFactory annotation.

transformback to summary
public default void transform(IListenersAnnotation annotation, Class<?> testClass)