Java Code Examples for org.testng.ITestNGMethod#isTest()

The following examples show how to use org.testng.ITestNGMethod#isTest() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AllureTestListener.java    From allure1 with Apache License 2.0 6 votes vote down vote up
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();
        }
    }
}
 
Example 2
Source File: ReflectionUtils.java    From test-data-supplier with Apache License 2.0 4 votes vote down vote up
public static Method findDataSupplier(final ITestNGMethod testMethod) {
    var annotationMetaData = testMethod.isTest()
            ? getTestAnnotationMetaData(testMethod)
            : getFactoryAnnotationMetaData(testMethod);
    return getDataSupplierMethod(annotationMetaData._1, annotationMetaData._2);
}