解析InvokeSpecial的TestNG Geb VerifyError字节代码

时间:2016-02-26 16:11:25

标签: java groovy testng functional-testing geb

我正在尝试使用最新发布的Geb和TestNG groovy / java库的Functional测试套件。似乎JDK存在问题,但我找不到任何有关解决此问题的信息。

测试的版本:

JDK 1.8.0_45 and JDK 1.8.0_74
Groovy 2.4.6
geb-testng 0.13.1
testng 6.9.10

例外:

org.gradle.api.internal.tasks.testing.TestSuiteExecutionException: Could not complete execution for Gradle Test Executor 2.
    at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:61)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
    at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
    at org.gradle.messaging.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
    at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
    at com.sun.proxy.$Proxy2.stop(Unknown Source)
    at org.gradle.api.internal.tasks.testing.worker.TestWorker.stop(TestWorker.java:116)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
    at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
    at org.gradle.messaging.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:360)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
    at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.VerifyError: Bad invokespecial instruction: current class isn't assignable to reference class.
Exception Details:
  Location:
    Testcases/UserManagementAddUserTest.super$2$setGebConfScript(Ljava/lang/String;)V @6: invokespecial
  Reason:
    Error exists in the bytecode
  Bytecode:
    0x0000000: b802 784d 2a2b b701 a32c 105e 0454 b1  

    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
    at java.lang.Class.privateGetPublicMethods(Class.java:2902)
    at java.lang.Class.getMethods(Class.java:1615)
    at org.testng.internal.TestNGClassFinder.(TestNGClassFinder.java:63)
    at org.testng.TestRunner.initMethods(TestRunner.java:424)
    at org.testng.TestRunner.init(TestRunner.java:247)
    at org.testng.TestRunner.init(TestRunner.java:217)
    at org.testng.TestRunner.(TestRunner.java:161)
    at org.testng.SuiteRunner$DefaultTestRunnerFactory.newTestRunner(SuiteRunner.java:556)
    at org.testng.SuiteRunner.init(SuiteRunner.java:168)
    at org.testng.SuiteRunner.(SuiteRunner.java:117)
    at org.testng.TestNG.createSuiteRunner(TestNG.java:1319)
    at org.testng.TestNG.createSuiteRunners(TestNG.java:1306)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1160)
    at org.testng.TestNG.run(TestNG.java:1064)
    at org.gradle.api.internal.tasks.testing.testng.TestNGTestClassProcessor.runTests(TestNGTestClassProcessor.java:136)
    at org.gradle.api.internal.tasks.testing.testng.TestNGTestClassProcessor.stop(TestNGTestClassProcessor.java:80)
    at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:59)
    ... 22 more

1 个答案:

答案 0 :(得分:0)

似乎必须使用升级的JDK 1.8.0_74重新编译Geb测试用例,次要版本22,45和66似乎不起作用。