在IntelliJ中运行grails测试困难:非法使用非虚函数调用 [英] Difficulty running grails tests in IntelliJ : Illegal use of nonvirtual function call
问题描述
|错误Error执行脚本TestApp:
(class:com / company / MyServiceSpec,method:super $ 2 $ oldImpl signature:
(Ljava / lang / Object;)Ljava / lang / Object;)
非法使用非虚函数调用(使用--stacktrace查看完整跟踪)
这是一个spock测试从命令行单独运行(通过指定类)或在整个测试应用程序系列中运行良好。实际上,我在这个项目中所有的spock和plain旧的单元或集成测试都给出了类似的IntelliJ故障。
我试过用测试的运行特性(开启或关闭类路径,运行单个方法,整个测试类或整个测试系列),但没有运气来纠正这种情况。我还做了一个 grails clean
,并尝试从IntelliJ重新运行它们:看起来好像它曾经工作过一次,我能够运行测试一段时间,但后来在做了一些工作后很快就出现问题了。
我知道这是一个模糊的问题,但有谁看到过类似的失败,并找到了可靠的补救措施?我在Grails 2.1和Spock 0.7上,在IntelliJ 12和13中都出现了同样的问题。
我设法解决这个问题,添加在我的配置中使用以下env变量:$ p $
_JAVA_OPTIONS =' - Xverify:none'
Lately I've been trying to run my spock tests in IntelliJ (which used to work beautifully and had great debugging / specific test re-running on failure features) and in the past few months I've began getting the following error:
| Error Error executing script TestApp:
(class: com/company/MyServiceSpec, method: super$2$oldImpl signature:
(Ljava/lang/Object;)Ljava/lang/Object;)
Illegal use of nonvirtual function call (Use --stacktrace to see the full trace)
It's a spock test that runs just fine from the command line, individually (by specifying the class) or in the entire test-app series. Virtually all of the spock and plain old Unit or Integration tests I have on this project give similar failures in IntelliJ.
I've tried twiddling with the run features of the test (having classpath on or off, running an individual method, a whole test class, or the entire test series) with no luck to remedying the situation. I've also done a grails clean
and tried re-running them from IntelliJ : that looked as if it worked once and I was able to run the tests for a little while, but then quickly after doing some work the problem now persists.
I know this is a bit of a vague question, but has anyone seen similar failures and found a reliable remedy? I'm on Grails 2.1 and Spock 0.7, same problem in both IntelliJ 12 and 13
I managed to solve this problem adding the following env variable in my configuration:
_JAVA_OPTIONS='-Xverify:none'
这篇关于在IntelliJ中运行grails测试困难:非法使用非虚函数调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!