Java 类org.testng.IMethodInterceptor 实例源码

项目:TestNG-Foundation    文件:ListenerChain.java   
/**
 * [IMethodInterceptor]
 * Invoked to enable alteration of the list of test methods that TestNG is about to run.
 * 
 * @param methods list of test methods.
 * @param context test context.
 * @return the list of test methods to run.
 */
@Override
public List<IMethodInstance> intercept(List<IMethodInstance> methods, ITestContext context) {
    synchronized (methodInterceptors) {
        for (IMethodInterceptor interceptor : methodInterceptors) {
            methods = interceptor.intercept(methods, context);
        }
    }
    return methods;
}