[Webtest] groovy-task ?

Dierk Koenig Dierk Koenig" <dierk.koenig@canoo.com
Tue, 3 Apr 2007 13:42:18 +0200


when setting a WebtestProperty you refer to it like

<echo message="what is today: #{webtest.rescal.today}" />

That is # instead of $.

regards
Dierk

> -----Original Message-----
> From: webtest-admin@lists.canoo.com
> [mailto:webtest-admin@lists.canoo.com]On Behalf Of Michael Habbert
> Sent: Dienstag, 3. April 2007 11:49
> To: webtest@lists.canoo.com
> Subject: [Webtest] groovy-task ?
>
>
> 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
>
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest