groovy question

SoapUI Pro announcements and discussions

groovy question

Postby alibaba82 » 12 Jun 2007 01:53

hello,
I have a groovy script that updates the database. The script works fine and updates the database. However, in the 'test log' i see the following entry after the corresponding to the groovy script.

-> Script-result: false

What does this mean ?

The groovy script looks like

import groovy.sql.Sql

//get email address from properties file
def EmailStep = testRunner.testCase.getTestStepByName("Properties");
Email = EmailStep.getPropertyValue("Email");
log.info(Email)

//update database to verify account
driver = Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver").newInstance();
sql = Sql.newInstance("jdbc:sqlserver://:1433;databaseName=databasename;user=;password=;") 
sql.execute(")");


THanks

Ali
alibaba82
soapui pro users
soapui pro users
 
Posts: 886
Joined: 18 Apr 2007 23:00

Re: groovy question

Postby omatzura » 12 Jun 2007 07:31

Hi Ali,

The script automatically returns the result of the last statement.. if you dont want to show anything in the log, please add

return null

at the end of your script..

regards!

/Ole
eviware.com
omatzura
Administrator
Administrator
 
Posts: 1918
Joined: 05 Jan 2007 23:39

Re: groovy question

Postby alibaba82 » 12 Jun 2007 18:01

so why does it return 'false'. My database was updated using the updated statement. shouldn't it return 'true'

Ali
alibaba82
soapui pro users
soapui pro users
 
Posts: 886
Joined: 18 Apr 2007 23:00

Re: groovy question

Postby omatzura » 12 Jun 2007 18:42

Hi Ali,

the execute method returns a flag indicating if the result was a resultSet (which could be further used..). In your case I guess the result is just a status-code or something..

regards,

/Ole
eviware.com
omatzura
Administrator
Administrator
 
Posts: 1918
Joined: 05 Jan 2007 23:39


Return to SoapUI Pro Support