Ale*_*uya 5 groovy testng annotations
when I add two annotations to a method like this
@Parameters({"userName",""})
@Test
public void replyMaster()
{
}
Run Code Online (Sandbox Code Playgroud)
得到了这个错误
Multiple markers at this line
- Groovy:unexpected token: @ @ line 40, column 2.
- Duplicate field ReplyTest.@
- Groovy:The field '@' is declared multiple times.
Run Code Online (Sandbox Code Playgroud)
我的配置:jdk 1.7,testng 6.8,groovy 2.0(安装了groovy eclipse插件)
为什么?
tim*_*tes 14
如果这是一个Groovy文件,那么
@Parameters({"userName",""})
Run Code Online (Sandbox Code Playgroud)
应该是:
@Parameters(["userName",""])
Run Code Online (Sandbox Code Playgroud)
要么
@Parameters(["userName",""] as Object[])
Run Code Online (Sandbox Code Playgroud)
不确定,我还没有使用过TestNG.但是你可以使用Groovy在每个节点上有多个注释,只是这不是groovy的列表或数组的方式