You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Paul Kronquist <pk...@uscentral.org> on 2004/12/03 18:12:37 UTC

BeanShell and Calendar

JMeter 2.0.1 question:

 

I have the following BeanShell script:

 

${__BeanShell(java.util.GregorianCalendar calendar = new
java.util.GregorianCalendar(); calendar.add(java.util.Calendar.DATE,
1); Date date = calendar.getTime(); new
java.text.SimpleDateFormat("MM/dd/yyyy").format(date))}

 

This does not work (i.e. it produces no output).

However, if I remove 'calendar.add(java.util.Calendar.DATE, 1);', it
works fine (producing today's date formatted).

 

I tested it in BeanShell 2.0b2 and it worked fine there (using
BeanShell Desktop 1.1).

 

Any ideas?

 

Paul Kronquist

 


Re: BeanShell and Calendar

Posted by sebb <se...@gmail.com>.
Are there any error messages in the jmeter.log file?

Might also be worth trying this in 2.0.2 - there were a few BeanShell
enhancements and fixes in that - as well as lots of other fixes.

S.
On Fri, 3 Dec 2004 11:12:37 -0600, Paul Kronquist
<pk...@uscentral.org> wrote:
> JMeter 2.0.1 question:
> 
> I have the following BeanShell script:
> 
> ${__BeanShell(java.util.GregorianCalendar calendar = new
> java.util.GregorianCalendar(); calendar.add(java.util.Calendar.DATE,
> 1); Date date = calendar.getTime(); new
> java.text.SimpleDateFormat("MM/dd/yyyy").format(date))}
> 
> This does not work (i.e. it produces no output).
> 
> However, if I remove 'calendar.add(java.util.Calendar.DATE, 1);', it
> works fine (producing today's date formatted).
> 
> I tested it in BeanShell 2.0b2 and it worked fine there (using
> BeanShell Desktop 1.1).
> 
> Any ideas?
> 
> 
> Paul Kronquist
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org