[英]Getting a Template/Generic java.lang.reflect.Method object from org.aspectj.lang.ProceedingJoinPoint
[英]Is there any way to convert from `org.testng.ITestResult` `ITestNGMethod` to `java.lang.reflect.Method`
我想获取每次运行测试类时执行的测试方法。 我使用以下代码
@AfterMethod
public void logout(ITestResult result){
Method method=result.getMethod(); //compliation error- Type mismatch: cannot convert from ITestNGMethod to Method
readAnnotation(method);
}
有什么办法可以将org.testng.ITestResult
ITestNGMethod
转换为java.lang.reflect.Method
您是否getConstructorOrMethod()
按照文档 getConstructorOrMethod()
? 然后,返回的ConstructorOrMethod
对象上的getMethod()
将为您提供基础方法
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.