[Webtest] groovy-task ?

Michael Habbert Michael Habbert <Michael.Habbert@netpioneer.de>
Tue, 03 Apr 2007 13:39:46 +0200


Hi folks,

found it by my self;-)?
the groovy-script worked but I asked for a ant.property (echo) and set by the script a 
webtest.property, so ...

Michael Habbert wrote:
> Hi Webtester,
> 
> why the ... is the following groovy task not working?
> 
> ----------
> <groovy description="find the next working day for vacation" >
>     def day = Calendar.getInstance()
>     def weekday = day.get(Calendar.DAY_OF_WEEK)
>     def sdf = new java.text.SimpleDateFormat("dd.MM.yyyy")
>     switch ( weekday ) {
>     case ( Calendar.SATURDAY ):
>       day.set(Calendar.DATE, 2)
>       println "hey we have saturday"
>       break;
>     case ( Calendar.SUNDAY ):
>       day.set(Calendar.DATE, 1)
>       println "hey we have sunday"
>       break;
>     default :
>       day.set(Calendar.DATE, 14)
>       println "hey we work to do"
>     }
>     step.setWebtestProperty ('webtest.rescal.today', sdf.format( 
> day.getTime() ))
> </groovy>
> 
> <echo message="what is today: ${webtest.rescal.today}" />
> ------------------------
> 
> on the comand-line I see:
> 
> [java]      [echo] what is today: 03.04.2007
> 
> but expected:
> 
>                                   17.04.2007
> 
> thanks for hints ...
> 


-- 
Mit freundlichen Grüßen
------------------------------------------------------------------------
Michael Habbert

Senior Developer
Netpioneer GmbH, Beiertheimer Allee 18, D-76137 Karlsruhe
Geschäftsführer: Axel Jahn
HRB: 107521 Handelsregister Mannheim

Tel: 0721 / 920 60 21
Fax: 0721 / 920 60 30
E-Mail: michael.habbert@netpioneer.de
www: http://www.netpioneer.de