You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by CharekC <ch...@gmail.com> on 2007/10/26 16:29:19 UTC
RE: BeanShell global synchronisation & variables
I've been looking at this to get random csv file values.
I have the following beanshell code:
ArrayList csv_array=null;
String getCSV_Value() {
if (csv_array==null)
// initialize csv_array from file
if (csv_array.size()>0)
//return random value from csv_array
else
// return error_value
}
I'm running into the problem where each call of
${__BeanShell(getCSV_Value())} initializes the csv_array.
I've tried the following:
1. renamed getCSV_Value() to execute()
2. tried public static ArrayList csv_array=null;
3. Placed the code and referenced it in jmeter.properties
beanshell.function.init=
beanshell.init.file=
So how can one make csv_array global and the getCSV_Value() method
synchronized? (Jmeter 2.3RC4)
Thanks
--
View this message in context: http://www.nabble.com/BeanShell-global-synchronisation---variables-tf2510205.html#a13428474
Sent from the JMeter - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org