groovyscriptengine

Create instances of java class using Groovy script

爷,独闯天下 提交于 2020-01-05 08:26:53
问题 I am using Groovy script and Java, I am new to the subject. I am trying to create multiple instances of a java class (A) from groovy script and pass them to list, then pass this list to a new class (B). my B java file is: public class B { public void getValues(List<A> values) {...} } my A java file is: public class A { public long num; public A(long num){ this.num = num; } } my main java files is: GroovyScriptEngine groovyScriptEngine = new GroovyScriptEngine(/*path to file.groovy*/); Binding

Create instances of java class using Groovy script

為{幸葍}努か 提交于 2020-01-05 08:26:15
问题 I am using Groovy script and Java, I am new to the subject. I am trying to create multiple instances of a java class (A) from groovy script and pass them to list, then pass this list to a new class (B). my B java file is: public class B { public void getValues(List<A> values) {...} } my A java file is: public class A { public long num; public A(long num){ this.num = num; } } my main java files is: GroovyScriptEngine groovyScriptEngine = new GroovyScriptEngine(/*path to file.groovy*/); Binding

How to send an email using groovy script in Soap UI?

落花浮王杯 提交于 2019-12-13 09:14:12
问题 I want to send an automated email once all my test steps are passed in SOAP UI, using a groovy script test step?? Is there a way that we can achieve this ?? 回答1: You will have to use a Java library such as Simple Java Mail and call it from Groovy in a Groovy Script Test Step. You can add external jars in the bin/ext directory of your SoapUI install, and they will be added to the classpath next time the tool is started. If you use the samples from a library, you can use the Java, in most cases