org.testng.ITestNGMethod#isTest ( )源码实例Demo

下面列出了org.testng.ITestNGMethod#isTest ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: allure1   文件: AllureTestListener.java
private void addPendingMethods(ITestContext iTestContext) {
    for (ITestNGMethod method : iTestContext.getExcludedMethods()) {
        if (method.isTest() && !method.getEnabled() && isInActiveGroup(method, iTestContext)) {
            Description description = new Description().withValue(method.getDescription());
            String suiteUid = getSuiteUid(iTestContext);
            TestCaseStartedEvent event = new TestCaseStartedEvent(suiteUid, method.getMethodName());
            if (description.getValue() != null) {
                event.setDescription(description);
            }
            Annotation[] annotations = method.getConstructorOrMethod().getMethod().getAnnotations();
            AnnotationManager am = new AnnotationManager(annotations);
            am.setDefaults(method.getInstance().getClass().getAnnotations());
            am.update(event);
            getLifecycle().fire(event);
            getLifecycle().fire(new TestCasePendingEvent());
            fireFinishTest();
        }
    }
}
 
源代码2 项目: test-data-supplier   文件: ReflectionUtils.java
public static Method findDataSupplier(final ITestNGMethod testMethod) {
    var annotationMetaData = testMethod.isTest()
            ? getTestAnnotationMetaData(testMethod)
            : getFactoryAnnotationMetaData(testMethod);
    return getDataSupplierMethod(annotationMetaData._1, annotationMetaData._2);
}