Java 类org.testng.annotations.Listeners 实例源码

项目:jira-dvcs-connector    文件:MockitoTestNgListener.java   
private boolean isAnnotated(Class<?> realClass)
{
    Listeners listeners = realClass.getAnnotation(Listeners.class);
    if (listeners == null)
    {
        return false;
    }
    for (Class<? extends ITestNGListener> listenerClass : listeners.value())
    {
        if (listenerClass.equals(MockitoTestNgListener.class))
        {
            return true;
        }
    }
    return false;
}
项目:ExtendNG    文件:ReflectionUtils.java   
@SuppressWarnings("unchecked")
static boolean shouldBeInvoked(Class testClass, Class<? extends ITestNGListener> listener){
    if(!testClass.isAnnotationPresent(Listeners.class))
        return false;
    if(asList(((Listeners) testClass.getAnnotation(Listeners.class)).value()).contains(listener))
        return true;

    return shouldBeInvoked(testClass.getSuperclass(), listener);
}
项目:mockito-cookbook    文件:MockitoTestNGListener.java   
protected boolean hasMockitoTestNGListener(Class<?> clazz) {
    Listeners listeners = clazz.getAnnotation(Listeners.class);
    if (listeners == null) {
        return false;
    }

    for (Class<? extends ITestNGListener> listenerClass : listeners.value()) {
        if (listenerClass() == listenerClass) {
            return true;
        }
    }
    return false;
}
项目:astor    文件:MockitoTestNGListener.java   
protected boolean hasMockitoTestNGListener(Class<?> clazz) {
    Listeners listeners = clazz.getAnnotation(Listeners.class);
    if (listeners == null) {
        return false;
    }

    for (Class<? extends ITestNGListener> listenerClass : listeners.value()) {
        if (listenerClass() == listenerClass) {
            return true;
        }
    }
    return false;
}
项目:video-recorder-java    文件:TestNgListener.java   
public boolean shouldIntercept(Class testClass, Class annotation) {
    Listeners listenersAnnotation = getListenersAnnotation(testClass);
    return listenersAnnotation != null && asList(listenersAnnotation.value()).contains(annotation);
}
项目:video-recorder-java    文件:TestNgListener.java   
private Listeners getListenersAnnotation(Class testClass) {
    Annotation annotation = testClass.getAnnotation(Listeners.class);
    return annotation != null ? (Listeners) annotation :
            testClass.getSuperclass() != null ? getListenersAnnotation(testClass.getSuperclass()) : null;
}