alibaba82
18 years agoSuper Contributor
Global Groovy scripts usage question
Hello,
I am trying to understand how the global groovy feature works but am having some problem. I tried the example and it worked fine. I then modified your Greet.groovy to the following.
package soapui.demo
class Greet
{
def salute()
{
log.info("testing")
}
}
I then create a groovy script containing
def greet = new soapui.demo.Greet( "Ole", log )
greet.salute()
and the response has
'Hello Ole'
Shouldnt response have 'testing'
Also if i define greet as
def greet = new soapui.demo.Greet( )
I get groovy.lang.GroovyRuntimeException: Could not find matching constructor for: soapui.demo.Greet()
Shouldn't this be ok (based on my java knowledge)
THanks
Ali
I am trying to understand how the global groovy feature works but am having some problem. I tried the example and it worked fine. I then modified your Greet.groovy to the following.
package soapui.demo
class Greet
{
def salute()
{
log.info("testing")
}
}
I then create a groovy script containing
def greet = new soapui.demo.Greet( "Ole", log )
greet.salute()
and the response has
'Hello Ole'
Shouldnt response have 'testing'
Also if i define greet as
def greet = new soapui.demo.Greet( )
I get groovy.lang.GroovyRuntimeException: Could not find matching constructor for: soapui.demo.Greet()
Shouldn't this be ok (based on my java knowledge)
THanks
Ali