Geb exception when running tests in maven

本秂侑毒 提交于 2019-12-12 02:52:53

问题


I get this exception when I run my tests from command line with maven. My command:

mvn -Dtest=specs.full.* -Dtestsystem=Win7/IE test

On my local machine, everything works fine. But when I run the tests on our server, where jenkins is installed, I get following exception:

java.lang.VerifyError: (class: specs/full/ReadCheckMenuLinks, method: super$8$$spock_feature_3_1 signature: ()V) Illegal use of nonvirtual function call
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2625)
at java.lang.Class.getMethod0(Class.java:2866)
at java.lang.Class.getMethod(Class.java:1676)
at org.apache.maven.surefire.util.ReflectionUtils.tryGetMethod(ReflectionUtils.java:57)
at org.apache.maven.surefire.common.junit3.JUnit3TestChecker.isSuiteOnly(JUnit3TestChecker.java:64)
at org.apache.maven.surefire.common.junit3.JUnit3TestChecker.isValidJUnit3Test(JUnit3TestChecker.java:59)
at org.apache.maven.surefire.common.junit3.JUnit3TestChecker.accept(JUnit3TestChecker.java:54)
at org.apache.maven.surefire.common.junit4.JUnit4TestChecker.accept(JUnit4TestChecker.java:52)
at org.apache.maven.surefire.util.DefaultScanResult.applyFilter(DefaultScanResult.java:97)
at org.apache.maven.surefire.junit4.JUnit4Provider.scanClassPath(JUnit4Provider.java:222)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:107)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)

The strange thing is, that the tests worked on the server, but now I get this exception on every test I run.

What could be the problem here?


回答1:


It will most probably be down to the jvm version you're using on your CI server. I've seen similar errors when using Groovy with particular builds of Java 8. Have a look at what your local version of jvm is and ensure that the one used by Jenkins is the same.



来源:https://stackoverflow.com/questions/36227008/geb-exception-when-running-tests-in-maven

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!