到目前为止(TestNG 6.9.10),TestNG提供了三个IAnnotationTransformer系列的监听器,这3个监听器的目的都是在TestNG执行过程中动态改变测试类中Annotation的参数。其区别在于不同的IAnnotationTransformer监听器,能够操作的Annotation不同,具体情况如下:
- IAnnotationTransformer,操作@Test标注
- IAnnotationTransformer2,操作@Configuration标注、@DataProvider标注和@Factory标注
- IAnnotationTransformer3,操作@Listeners标注
下面以最常