java - 添加多个 testng 注释
问题描述
@Test
@MyAnnotations({
@MyDefindeAnnotation(name="A"),
@MyDefindeAnnotation(name="B")
})
public void testMix(){}
我想定义一个注释“MyAnnotations”,其中包含一个名为“MyDefindeAnnotation”的注释列表。MyDefindeAnnotation 可以在运行 case 之前和之后做一些事情。我想多次运行 testMix(),每次都使用不同的 MyDefindeAnotaion。</p>
就像这样: 第一次:MyDefindeAnnotation-A 做某事 -> 运行 testMix() -> MyDefindeAnnotation-A 做某事 第二次:MyDefindeAnnotation-B 做某事 -> 运行 testMix() -> MyDefindeAnnotation-B 做某事 如果只是添加一个注解,我可以使用 IInvokedMethodListener,覆盖 onStart() 方法或 beforeInvocation() 方法。但是我想要多个Annotation,我不知道如何循环运行案例。
解决方案
推荐阅读
- javascript - 使用 match() 进行正则表达式反应应用程序出错
- javascript - 什么是迭代器/生成器/可迭代?(Javascript)
- javascript - Firefox 仍然在调试屏幕中显示过期的 cokies
- c++ - 用 C++ 从书中查找字符
- android-studio - 跳转到 Windows 上的源 android studio 不工作
- typescript - 如何在 FP 尤其是 fp-ts 中管理 monad
- java - 如何在 Java 中的 HandleBar 中进行货币格式化?
- python - 使用 Turtle 的 Sierpinski 地毯 Python 错误
- javascript - 不允许使用 Django 方法 (POST) 405
- sql - SAP HANA SQL 匹配字符串模式和组合