You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by John Lussmyer <Jo...@amdocs.com> on 2011/11/18 19:34:53 UTC

Calling library method that takes a List

We  have a method in an externally loaded jar that I'd like to call.
The problem is that one of the parameters is a List<String[]>.
I haven't figured out how to create such a list in JMeter scripting.
Is it possible?


This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement,
you may review at http://www.amdocs.com/email_disclaimer.asp

RE: Calling library method that takes a List

Posted by John Lussmyer <Jo...@amdocs.com>.
Okay, that was the hint I needed.
I deleted the <String[]> from the declarations, and it seems to be working now!
Thanks!

-----Original Message-----
From: sebb [mailto:sebbaz@gmail.com] 
Sent: Friday, November 18, 2011 10:51 AM
To: JMeter Users List
Subject: Re: Calling library method that takes a List

On 18 November 2011 18:40, John Lussmyer <Jo...@amdocs.com> wrote:
> For the code,
>        String[] hval = new String[2];
>        hval[0] = "X-ACTOR";
>        hval[1] = primaryID;
>        List<String[]> headers = new ArrayList<String[]>();

I don't think Beanshell supports generics.

BTW, usually it's not necessary to declare variables in Beanshell.

>        headers.add( hval);
>
> I get:
> Response message: org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval      In file: inline evaluation of: ``import com.qpass.jmeter.WebServiceUtilityForJmeter; import com.qpass.utility.CAP . . . '' Encountered "] >" at line 81, column 21.
>
> Since the beanShell editor doesn't show linenum or column num, I'm guessing that the error is on the ArrayList allocation line.
>
> -----Original Message-----
> From: Deepak Shetty [mailto:shettyd@gmail.com]
> Sent: Friday, November 18, 2011 10:37 AM
> To: JMeter Users List
> Subject: Re: Calling library method that takes a List
>
> should be possible in beanshell. - are you getting an error? if so what?
>
> regards
> deepak
>
> On Fri, Nov 18, 2011 at 10:34 AM, John Lussmyer <Jo...@amdocs.com>wrote:
>
>> We  have a method in an externally loaded jar that I'd like to call.
>> The problem is that one of the parameters is a List<String[]>.
>> I haven't figured out how to create such a list in JMeter scripting.
>> Is it possible?
>>
>>
>> This message and the information contained herein is proprietary and
>> confidential and subject to the Amdocs policy statement,
>> you may review at http://www.amdocs.com/email_disclaimer.asp
>>
> This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement,
> you may review at http://www.amdocs.com/email_disclaimer.asp
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>

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


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


Re: Calling library method that takes a List

Posted by sebb <se...@gmail.com>.
On 18 November 2011 18:40, John Lussmyer <Jo...@amdocs.com> wrote:
> For the code,
>        String[] hval = new String[2];
>        hval[0] = "X-ACTOR";
>        hval[1] = primaryID;
>        List<String[]> headers = new ArrayList<String[]>();

I don't think Beanshell supports generics.

BTW, usually it's not necessary to declare variables in Beanshell.

>        headers.add( hval);
>
> I get:
> Response message: org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval      In file: inline evaluation of: ``import com.qpass.jmeter.WebServiceUtilityForJmeter; import com.qpass.utility.CAP . . . '' Encountered "] >" at line 81, column 21.
>
> Since the beanShell editor doesn't show linenum or column num, I'm guessing that the error is on the ArrayList allocation line.
>
> -----Original Message-----
> From: Deepak Shetty [mailto:shettyd@gmail.com]
> Sent: Friday, November 18, 2011 10:37 AM
> To: JMeter Users List
> Subject: Re: Calling library method that takes a List
>
> should be possible in beanshell. - are you getting an error? if so what?
>
> regards
> deepak
>
> On Fri, Nov 18, 2011 at 10:34 AM, John Lussmyer <Jo...@amdocs.com>wrote:
>
>> We  have a method in an externally loaded jar that I'd like to call.
>> The problem is that one of the parameters is a List<String[]>.
>> I haven't figured out how to create such a list in JMeter scripting.
>> Is it possible?
>>
>>
>> This message and the information contained herein is proprietary and
>> confidential and subject to the Amdocs policy statement,
>> you may review at http://www.amdocs.com/email_disclaimer.asp
>>
> This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement,
> you may review at http://www.amdocs.com/email_disclaimer.asp
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>

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


RE: Calling library method that takes a List

Posted by John Lussmyer <Jo...@amdocs.com>.
For the code,
	String[] hval = new String[2];
	hval[0] = "X-ACTOR";
	hval[1] = primaryID;
	List<String[]> headers = new ArrayList<String[]>();
	headers.add( hval);

I get:
Response message: org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval	In file: inline evaluation of: ``import com.qpass.jmeter.WebServiceUtilityForJmeter; import com.qpass.utility.CAP . . . '' Encountered "] >" at line 81, column 21.

Since the beanShell editor doesn't show linenum or column num, I'm guessing that the error is on the ArrayList allocation line.

-----Original Message-----
From: Deepak Shetty [mailto:shettyd@gmail.com] 
Sent: Friday, November 18, 2011 10:37 AM
To: JMeter Users List
Subject: Re: Calling library method that takes a List

should be possible in beanshell. - are you getting an error? if so what?

regards
deepak

On Fri, Nov 18, 2011 at 10:34 AM, John Lussmyer <Jo...@amdocs.com>wrote:

> We  have a method in an externally loaded jar that I'd like to call.
> The problem is that one of the parameters is a List<String[]>.
> I haven't figured out how to create such a list in JMeter scripting.
> Is it possible?
>
>
> This message and the information contained herein is proprietary and
> confidential and subject to the Amdocs policy statement,
> you may review at http://www.amdocs.com/email_disclaimer.asp
>
This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement,
you may review at http://www.amdocs.com/email_disclaimer.asp


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


Re: Calling library method that takes a List

Posted by Deepak Shetty <sh...@gmail.com>.
should be possible in beanshell. - are you getting an error? if so what?

regards
deepak

On Fri, Nov 18, 2011 at 10:34 AM, John Lussmyer <Jo...@amdocs.com>wrote:

> We  have a method in an externally loaded jar that I'd like to call.
> The problem is that one of the parameters is a List<String[]>.
> I haven't figured out how to create such a list in JMeter scripting.
> Is it possible?
>
>
> This message and the information contained herein is proprietary and
> confidential and subject to the Amdocs policy statement,
> you may review at http://www.amdocs.com/email_disclaimer.asp
>