Hi mark,

I've done that with several manners yet. The more flexible for me is the "end of step interception".
You can put listeners on steps processed with Ant like :
def webtest //triggered when task has finished ant.getAntProject().taskFinished = {buildEvent -> def task = buildEvent.task println "Task finished ............ $task.taskType" //testSpec is the main Step, but you can find anyone of your script's steps by this method if (task.taskType == 'testSpec'){ //here I print the value of the stored properties at the end of the test task.dynamicProperties.each {key, value -> println key + " : " + value} //test if there is a failing task in the script def all_right=task.getResultBuilderListener().getRootResult().getFailingTaskResult() if (all_right==null){ //executing the query sql.execute(""" update db set field=1
                                                               """)
                                                             }
                                                         }
}
   //triggered when task is about to begin
ant.getAntProject().taskStarted = { buildEvent -> def task = buildEvent.task if (task.taskType == 'testSpec'){
                                                             webtest = task
} } That may not be the simpliest way, but that brings control on the steps and their execution

Hope that helps

Florent

Pingwy
27, rue des arènes
49100 Angers



Mark Johnson a écrit :
I have a groovy based webtest which needs to verify that the database has been properly updated. I am assuming that my groovy db SQL queries are not performing in the web test script because they are getting called when the antbuilder is preparing the test. Is this a correct assumption? If so, does anyone have an alternate strategy for doing a sql query within the web script?

thanks for your help

mark

Reply via email to