Search in sources :

Example 1 with ConstructorOrMethod

use of org.testng.internal.ConstructorOrMethod in project cloudstack by apache.

the class TestNGAop method intercept.

@Override
public List<IMethodInstance> intercept(List<IMethodInstance> methods, ITestContext context) {
    for (IMethodInstance methodIns : methods) {
        ITestNGMethod method = methodIns.getMethod();
        ConstructorOrMethod meth = method.getConstructorOrMethod();
        Method m = meth.getMethod();
        if (m != null) {
            DB db = m.getAnnotation(DB.class);
            if (db != null) {
                TransactionLegacy txn = TransactionLegacy.open(m.getName());
            }
        }
    }
    // TODO Auto-generated method stub
    return methods;
}
Also used : TransactionLegacy(com.cloud.utils.db.TransactionLegacy) ITestNGMethod(org.testng.ITestNGMethod) IMethodInstance(org.testng.IMethodInstance) ITestNGMethod(org.testng.ITestNGMethod) Method(java.lang.reflect.Method) ConstructorOrMethod(org.testng.internal.ConstructorOrMethod) DB(com.cloud.utils.db.DB) ConstructorOrMethod(org.testng.internal.ConstructorOrMethod)

Aggregations

DB (com.cloud.utils.db.DB)1 TransactionLegacy (com.cloud.utils.db.TransactionLegacy)1 Method (java.lang.reflect.Method)1 IMethodInstance (org.testng.IMethodInstance)1 ITestNGMethod (org.testng.ITestNGMethod)1 ConstructorOrMethod (org.testng.internal.ConstructorOrMethod)1