2017-03-02 79 views

回答

1

您只需要使用IAnnotationTransformer并将其注册为listener

public class RunAllTests implements IAnnotationTransformer { 
    public void transform(ITest annotation, Class<?> testClass, 
     Constructor testConstructor, Method testMethod) { 
     annotation.setEnabled(true); 
    } 
} 
0

您可以尝试使用AspectJ并创建切入点以注释@Test(enabled = false)。然而,我不确定如果您使用@Test(enabled = true)进行了批注,如果之前设置了@Test(enabled = false),会发生什么情况。你可以在进入AspectJ之前先验证一下。

+0

感谢您的回应。会看到这一点。 – xploreraj

相关问题