при попытке выполнить скрипт Groovy в SOAPUI 5.4.0
class MyClass {
// The three following fields are MANDATORY
def log
def context
def testRunner
public MyClass(log,context,testRunner){
this.log = log
this.context = context
this.testRunner = testRunner
}
def MyMethod(){log.info "Reference Groovy function file" }
}
class Call{
MyClass myClass = new MyClass();
myClass.MyMethod();
}
и получение ошибки, т. Е.
groovy.lang.GroovyRuntimeException: не удалось создать экземпляр сценария для класса:класс MyClass.Причина: java.lang.InstantiationException: MyClass
тот же код работал в предыдущей версии мыла UI, не могли бы вы помочь.
стек ошибок
*Tue May 29 15:43:08 IST 2018:ERROR:cannot get error line number!
Tue May 29 15:43:08 IST 2018:ERROR:java.lang.IllegalStateException: No match found
java.lang.IllegalStateException: No match found
at java.util.regex.Matcher.group(Matcher.java:536)
at com.eviware.soapui.support.GroovyUtils.extractErrorLineNumber(GroovyUtils.java:128)
at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:163)
at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:250)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Tue May 29 15:43:08 IST 2018:ERROR:groovy.lang.GroovyRuntimeException: Failed to create Script instance for class: class MyClass. Reason: java.lang.InstantiationException: MyClass
groovy.lang.GroovyRuntimeException: Failed to create Script instance for class: class MyClass. Reason: java.lang.InstantiationException: MyClass
at org.codehaus.groovy.runtime.InvokerHelper.createScript(InvokerHelper.java:464)
at groovy.lang.GroovyShell.parse(GroovyShell.java:706)
at groovy.lang.GroovyShell.parse(GroovyShell.java:742)
at groovy.lang.GroovyShell.parse(GroovyShell.java:733)
at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.compile(SoapUIGroovyScriptEngine.java:136)
at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:87)
at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:141)
at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:250)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.InstantiationException: MyClass
at java.lang.Class.newInstance(Class.java:427)
at org.codehaus.groovy.runtime.InvokerHelper.createScript(InvokerHelper.java:436)
... 10 more
Caused by: java.lang.NoSuchMethodException: MyClass.<init>()
at java.lang.Class.getConstructor0(Class.java:3082)
at java.lang.Class.newInstance(Class.java:412)
... 11 more*