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 <
[email protected]> wrote:

> Am 01.07.2015 um 08:31 schrieb Philippe Mouawad:
>
>> On Wednesday, July 1, 2015, sebb <[email protected]> wrote:
>>
>>  On 30 June 2015 at 20:16, Philippe Mouawad <[email protected]
>>> <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.

Reply via email to