You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by sebb <se...@gmail.com> on 2015/07/01 00:30:49 UTC

Re: Field name/description of Parameters in JSR223TestElement / BSFTestElement/BeanshellTestElements

On 30 June 2015 at 20:16, Philippe Mouawad <ph...@gmail.com> wrote:
> Hello,
> In the elements I mentionned above, the field parameters is documented as:
>
> - Parameters to be passed to script (=> String Parameters and String []args)
>
> I don't understand what is meant by:
> -=> String Parameters and String []args

This is explained under "Parameters" here:

http://jmeter.apache.org/usermanual/component_reference.html#BeanShell_Sampler

> As Parameters is of type String , so what does String[] args mean in this
> context ?
>
> I find it very confusing.
>
> Unless there is a reason I am going to change it to:
>
> Parameters to be passed to script (=> Field is of type java.lang.String)

No, see above.

> Furthermore in JSR223TestElement , I will modify those:
> cacheKey_group.displayName=Script compilation caching (Mandatory for
> performances)

s/performances/performance/

> cacheKey.shortDescription=This key should always be configured. If Cache
> key is not empty, script will be compiled if JSR223 underlying script
> language supports it and CompiledScript will be cached, ensure script does
> not use any variable before making it cacheable. It is critical to
> configure this key to obtain the best performances.
>

s/performances/performance/

>
> --
> Cordialement.
> Philippe .

Re: Field name/description of Parameters in JSR223TestElement / BSFTestElement/BeanshellTestElements

Posted by Felix Schumacher <fe...@internetallee.de>.

Am 1. Juli 2015 22:29:59 MESZ, schrieb Philippe Mouawad <ph...@gmail.com>:
>Hello,
>I confirm that in the 3 samplers:
>log.warn(""+Parameters.getClass());
>log.warn(""+args.getClass());
>
>Will show:
>2015/07/01 16:48:36 WARN  - jmeter.util.BeanShellTestElement: class
>java.lang.String
>2015/07/01 16:48:36 WARN  - jmeter.util.BeanShellTestElement: class
>[Ljava.lang.String;
>2015/07/01 16:48:36 WARN  - jmeter.protocol.java.sampler.BSFSampler:
>class
>java.lang.String
>2015/07/01 16:48:36 WARN  - jmeter.protocol.java.sampler.BSFSampler:
>class
>[Ljava.lang.String;
>2015/07/01 16:48:36 WARN  - jmeter.protocol.java.sampler.JSR223Sampler:
>class java.lang.String
>2015/07/01 16:48:36 WARN  - jmeter.protocol.java.sampler.JSR223Sampler:
>class [Ljava.lang.String;
>
>
>But I think this field name is not clear and should be improved.
>Maybe something like:
>
>   - parameters : Passed under 2 names  Parameters (of type String) and
>   args (of type String[])

I thought the same. The name should be args without the brackets. 

>
>Also by the way as JSR223 is the advised Test element maybe we should
>move
>BSF documentation to JSR223 and point BSF to JSR223.

Probably a good idea, too. 
>
>@Felix, my answer below.
>
>REgards
>
>
>On Wed, Jul 1, 2015 at 10:21 PM, Felix Schumacher <
>felix.schumacher@internetallee.de> wrote:
>
>> Am 01.07.2015 um 08:31 schrieb Philippe Mouawad:
>>
>>> On Wednesday, July 1, 2015, sebb <se...@gmail.com> wrote:
>>>
>>>  On 30 June 2015 at 20:16, Philippe Mouawad
><philippe.mouawad@gmail.com
>>>> <javascript:;>> wrote:
>>>>
>>>>> Hello,
>>>>> In the elements I mentionned above, the field parameters is
>documented
>>>>>
>>>> as:
>>>>
>>>>> - Parameters to be passed to script (=> String Parameters and
>String
>>>>>
>>>> []args)
>>>>
>>>>> I don't understand what is meant by:
>>>>> -=> String Parameters and String []args
>>>>>
>>>> This is explained under "Parameters" here:
>>>>
>>>>
>>>>
>>>>
>http://jmeter.apache.org/usermanual/component_reference.html#BeanShell_Sampler
>>>>
>>>
>>> Maybe it's the case for Beanshell but is it really the case for
>JSR223 and
>>> BSF ?
>>>
>>> I tried passing a String separated by spaces and no array is passed,
>just
>>> a
>>> String
>>>
>> In JSR223TestElement in populateBindings() there is a binding to
>args,
>> which is filled with a splitted version of Parameters. So it should
>work.
>>
>> Another thing I noticed are the documented bindings for BSF Listener
>> (which are probably the same for the other BSF/JSR223-TestElement
>based
>> ones). The bindings "sampleResult" and "sampleEvent" are documented,
>but I
>> don't see them populated in populateBindings().
>>
>> Are they really bound?
>>
>Yes in sampleOccured

Will have a look again and format the two variables in the docs accordingly. 

Felix
>
>>
>> Regards,
>>  Felix
>>
>>  As Parameters is of type String , so what does String[] args mean in
>this
>>>>> context ?
>>>>>
>>>>> I find it very confusing.
>>>>>
>>>>> Unless there is a reason I am going to change it to:
>>>>>
>>>>> Parameters to be passed to script (=> Field is of type
>java.lang.String)
>>>>>
>>>> No, see above.
>>>>
>>>>  Furthermore in JSR223TestElement , I will modify those:
>>>>> cacheKey_group.displayName=Script compilation caching (Mandatory
>for
>>>>> performances)
>>>>>
>>>> s/performances/performance/
>>>>
>>>>  cacheKey.shortDescription=This key should always be configured. If
>Cache
>>>>> key is not empty, script will be compiled if JSR223 underlying
>script
>>>>> language supports it and CompiledScript will be cached, ensure
>script
>>>>>
>>>> does
>>>>
>>>>> not use any variable before making it cacheable. It is critical to
>>>>> configure this key to obtain the best performances.
>>>>>
>>>>>  s/performances/performance/
>>>>
>>>>  --
>>>>> Cordialement.
>>>>> Philippe .
>>>>>
>>>>
>>>
>>


Re: Field name/description of Parameters in JSR223TestElement / BSFTestElement/BeanshellTestElements

Posted by Philippe Mouawad <ph...@gmail.com>.
Hello,
I confirm that in the 3 samplers:
log.warn(""+Parameters.getClass());
log.warn(""+args.getClass());

Will show:
2015/07/01 16:48:36 WARN  - jmeter.util.BeanShellTestElement: class
java.lang.String
2015/07/01 16:48:36 WARN  - jmeter.util.BeanShellTestElement: class
[Ljava.lang.String;
2015/07/01 16:48:36 WARN  - jmeter.protocol.java.sampler.BSFSampler: class
java.lang.String
2015/07/01 16:48:36 WARN  - jmeter.protocol.java.sampler.BSFSampler: class
[Ljava.lang.String;
2015/07/01 16:48:36 WARN  - jmeter.protocol.java.sampler.JSR223Sampler:
class java.lang.String
2015/07/01 16:48:36 WARN  - jmeter.protocol.java.sampler.JSR223Sampler:
class [Ljava.lang.String;


But I think this field name is not clear and should be improved.
Maybe something like:

   - parameters : Passed under 2 names  Parameters (of type String) and
   args (of type String[])

Also by the way as JSR223 is the advised Test element maybe we should move
BSF documentation to JSR223 and point BSF to JSR223.

@Felix, my answer below.

REgards


On Wed, Jul 1, 2015 at 10:21 PM, Felix Schumacher <
felix.schumacher@internetallee.de> wrote:

> Am 01.07.2015 um 08:31 schrieb Philippe Mouawad:
>
>> On Wednesday, July 1, 2015, sebb <se...@gmail.com> wrote:
>>
>>  On 30 June 2015 at 20:16, Philippe Mouawad <philippe.mouawad@gmail.com
>>> <javascript:;>> wrote:
>>>
>>>> Hello,
>>>> In the elements I mentionned above, the field parameters is documented
>>>>
>>> as:
>>>
>>>> - Parameters to be passed to script (=> String Parameters and String
>>>>
>>> []args)
>>>
>>>> I don't understand what is meant by:
>>>> -=> String Parameters and String []args
>>>>
>>> This is explained under "Parameters" here:
>>>
>>>
>>>
>>> http://jmeter.apache.org/usermanual/component_reference.html#BeanShell_Sampler
>>>
>>
>> Maybe it's the case for Beanshell but is it really the case for JSR223 and
>> BSF ?
>>
>> I tried passing a String separated by spaces and no array is passed, just
>> a
>> String
>>
> In JSR223TestElement in populateBindings() there is a binding to args,
> which is filled with a splitted version of Parameters. So it should work.
>
> Another thing I noticed are the documented bindings for BSF Listener
> (which are probably the same for the other BSF/JSR223-TestElement based
> ones). The bindings "sampleResult" and "sampleEvent" are documented, but I
> don't see them populated in populateBindings().
>
> Are they really bound?
>
Yes in sampleOccured

>
> Regards,
>  Felix
>
>  As Parameters is of type String , so what does String[] args mean in this
>>>> context ?
>>>>
>>>> I find it very confusing.
>>>>
>>>> Unless there is a reason I am going to change it to:
>>>>
>>>> Parameters to be passed to script (=> Field is of type java.lang.String)
>>>>
>>> No, see above.
>>>
>>>  Furthermore in JSR223TestElement , I will modify those:
>>>> cacheKey_group.displayName=Script compilation caching (Mandatory for
>>>> performances)
>>>>
>>> s/performances/performance/
>>>
>>>  cacheKey.shortDescription=This key should always be configured. If Cache
>>>> key is not empty, script will be compiled if JSR223 underlying script
>>>> language supports it and CompiledScript will be cached, ensure script
>>>>
>>> does
>>>
>>>> not use any variable before making it cacheable. It is critical to
>>>> configure this key to obtain the best performances.
>>>>
>>>>  s/performances/performance/
>>>
>>>  --
>>>> Cordialement.
>>>> Philippe .
>>>>
>>>
>>
>


-- 
Cordialement.
Philippe Mouawad.

Re: Field name/description of Parameters in JSR223TestElement / BSFTestElement/BeanshellTestElements

Posted by Felix Schumacher <fe...@internetallee.de>.
Am 01.07.2015 um 08:31 schrieb Philippe Mouawad:
> On Wednesday, July 1, 2015, sebb <se...@gmail.com> wrote:
>
>> On 30 June 2015 at 20:16, Philippe Mouawad <philippe.mouawad@gmail.com
>> <javascript:;>> wrote:
>>> Hello,
>>> In the elements I mentionned above, the field parameters is documented
>> as:
>>> - Parameters to be passed to script (=> String Parameters and String
>> []args)
>>> I don't understand what is meant by:
>>> -=> String Parameters and String []args
>> This is explained under "Parameters" here:
>>
>>
>> http://jmeter.apache.org/usermanual/component_reference.html#BeanShell_Sampler
>
> Maybe it's the case for Beanshell but is it really the case for JSR223 and
> BSF ?
>
> I tried passing a String separated by spaces and no array is passed, just a
> String
In JSR223TestElement in populateBindings() there is a binding to args, 
which is filled with a splitted version of Parameters. So it should work.

Another thing I noticed are the documented bindings for BSF Listener 
(which are probably the same for the other BSF/JSR223-TestElement based 
ones). The bindings "sampleResult" and "sampleEvent" are documented, but 
I don't see them populated in populateBindings().

Are they really bound?

Regards,
  Felix
>>> As Parameters is of type String , so what does String[] args mean in this
>>> context ?
>>>
>>> I find it very confusing.
>>>
>>> Unless there is a reason I am going to change it to:
>>>
>>> Parameters to be passed to script (=> Field is of type java.lang.String)
>> No, see above.
>>
>>> Furthermore in JSR223TestElement , I will modify those:
>>> cacheKey_group.displayName=Script compilation caching (Mandatory for
>>> performances)
>> s/performances/performance/
>>
>>> cacheKey.shortDescription=This key should always be configured. If Cache
>>> key is not empty, script will be compiled if JSR223 underlying script
>>> language supports it and CompiledScript will be cached, ensure script
>> does
>>> not use any variable before making it cacheable. It is critical to
>>> configure this key to obtain the best performances.
>>>
>> s/performances/performance/
>>
>>> --
>>> Cordialement.
>>> Philippe .
>


Re: Field name/description of Parameters in JSR223TestElement / BSFTestElement/BeanshellTestElements

Posted by Philippe Mouawad <ph...@gmail.com>.
On Wednesday, July 1, 2015, sebb <se...@gmail.com> wrote:

> On 30 June 2015 at 20:16, Philippe Mouawad <philippe.mouawad@gmail.com
> <javascript:;>> wrote:
> > Hello,
> > In the elements I mentionned above, the field parameters is documented
> as:
> >
> > - Parameters to be passed to script (=> String Parameters and String
> []args)
> >
> > I don't understand what is meant by:
> > -=> String Parameters and String []args
>
> This is explained under "Parameters" here:
>
>
> http://jmeter.apache.org/usermanual/component_reference.html#BeanShell_Sampler


Maybe it's the case for Beanshell but is it really the case for JSR223 and
BSF ?

I tried passing a String separated by spaces and no array is passed, just a
String

>
> > As Parameters is of type String , so what does String[] args mean in this
> > context ?
> >
> > I find it very confusing.
> >
> > Unless there is a reason I am going to change it to:
> >
> > Parameters to be passed to script (=> Field is of type java.lang.String)
>
> No, see above.
>
> > Furthermore in JSR223TestElement , I will modify those:
> > cacheKey_group.displayName=Script compilation caching (Mandatory for
> > performances)
>
> s/performances/performance/
>
> > cacheKey.shortDescription=This key should always be configured. If Cache
> > key is not empty, script will be compiled if JSR223 underlying script
> > language supports it and CompiledScript will be cached, ensure script
> does
> > not use any variable before making it cacheable. It is critical to
> > configure this key to obtain the best performances.
> >
>
> s/performances/performance/
>
> >
> > --
> > Cordialement.
> > Philippe .
>


-- 
Cordialement.
Philippe Mouawad.