Last active
August 29, 2015 14:14
-
-
Save sahajamit/dcca16e59ab9e41499a7 to your computer and use it in GitHub Desktop.
Testng annotation transformer to apply @test annotation at runtime . Here we are setting the timeout using it.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.testng.practise; | |
import java.lang.reflect.Constructor; | |
import java.lang.reflect.Method; | |
import org.testng.IAnnotationTransformer; | |
import org.testng.ITest; | |
import org.testng.annotations.ITestAnnotation; | |
import org.testng.annotations.Test; | |
import org.testng.IAnnotationTransformer; | |
public class TestNGAnnotationTransformer implements IAnnotationTransformer{ | |
@Override | |
public void transform(ITestAnnotation annotation, Class testClass, | |
Constructor testConstructor, Method testMethod) { | |
annotation.setTimeOut(2000); | |
annotation.getInvocationCount(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment