2016-10-10 64 views
1

在TestNG的,你做的方法如下禁用测试:是否有无法找到TestNG套件中禁用的所有测试?

@Test(enabled = false) 

我在想,如果有擦洗整个套件,以便找到所有这一切都使集到的方法的自动化的方式假?

+0

您可以在项目中做一个搜索特定字符串,'@Test(启用= FALSE)'。这会告诉你每个实例在哪里使用。 – Brian

+0

我将如何在IDE中做到这一点? (我正在使用Eclipse) – Jason

+0

CTRL + ALT + G. – Brian

回答

4

您可以使用IAnnotationTransformer

public class MyTransformer implements IAnnotationTransformer { 

    public void transform(ITest annotation, Class testClass, Constructor testConstructor, Method testMethod) { 
    if (!annotation.getEnabled()) { 
     System.out.println(testClass != null ? testClass : testMethod); 
    } 
    } 
} 
相关问题