On 04/11/05, Alex Eagar <[EMAIL PROTECTED]> wrote:
> JMeter v. 2.1.1 with bsh-2.0b4.jar and j2sdk1.4.2_10
> on Windows XP SP2.
>
> --- The Problem ---
> Within a BeanShell Sampler, I have the following:
> import
> org.apache.jmeter.protocol.http.sampler.HTTPSampleResult;
>
> HTTPSampleResult res = new HTTPSampleResult();
>
> print("res == " + res);
>
> When run, the terminal prints the following:
> res == null
>

I've now had a chance to look at this further.

The null is expected, because the print statement actually means:

print("res == " + res.toString());

As you saw, HTTPSampleResult extends SampleResult.

Now SampleResult.toString() method returns getSampleLabel() which is
null unless the label has been set.

Try

print("res == " + res.Class);

and you will see that res is not actually null.

Note that the BeanShell sampler already passes in a SampleResult in
the variable "SampleResult".

S.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to