TestNG的IInvokedMethodListener监听器详解
来源:互联网 发布:csol由于网络设定问题 编辑:程序博客网 时间:2024/05/17 02:26
在TestNG的执行过程中,通过IInvokedMethodListener监听器,能够在调用某个测试方法之前或者之后发出通知。
目前,该监听器只支持调用如下测试方法时发出通知:
- @Test方法
- Configuration方法,即@Before*方法和@After*方法
IInvokedMethodListener监听器中定义了如下两个方法,分别表示在被调用的测试方法之前或之后发出通知:
void beforeInvocation(IInvokedMethod method, ITestResult testResult);void afterInvocation(IInvokedMethod method, ITestResult testResult);
此外,TestNG还提供了IInvokedMethodListener2监听器,其中定义的两个方法还提供了加入用户信息的参数,如下所示:
void beforeInvocation(IInvokedMethod method, ITestResult testResult, ITestContext context);void afterInvocation(IInvokedMethod method, ITestResult testResult, ITestContext context);
IInvokedMethodListener监听器的实现,以及在TestNG中的使用,与其他监听器类似。
1 0
- TestNG的IInvokedMethodListener监听器详解
- TestNG的IAnnotationTransformer监听器详解
- TestNG的IMethodInterceptor监听器详解
- TestNG的IHookable监听器详解
- TestNG的IConfigurable监听器详解
- TestNG的IConfigurationListener监听器详解
- TestNG的IExecutionListener监听器详解
- TestNG的ISuiteListener监听器和IAlterSuiteListener监听器详解
- TestNG的监听器概述
- TestNg监听器(一)-----监听器的类型和配置使用的方法---附加META-INF详解
- TestNG 创建自定义的监听器
- testng监听器
- TestNG提供的几种监听器
- 实战 TestNG 监听器
- 实战 TestNG 监听器
- Testng监听器listener-ITestListener
- Testng监听器listener-ReportNg
- TestNG提供的标注详解
- Gson搭配TypeToken实现复杂数据的解析
- Binary Tree Paths
- ubuntu下搭建android开发环境(四)核心篇安装AndroidStudio、sdk、jdk(by 星空武哥)
- 对虚函数的初步理解
- 静态库,共享库,动态加载库
- TestNG的IInvokedMethodListener监听器详解
- Nginx+Tomcat+Redis负载均衡集群服务搭建
- 数据结构与算法(9)顺序查找
- UVA 10817 Headmaster's Headache
- Ubuntu上安装oracle java 7
- 拆机记(1)
- ASP.NET视频知识总结 chapter1 & chapter2
- C++ 预处理指定基础知识
- 关于一种全新的选择困难