jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: New to jmeter.. simple question "Way to easily read property in AbstractJavaSamplerClient implementation?"
Date Fri, 18 Sep 2009 22:06:24 GMT
On 18/09/2009, Rick <rickcr@gmail.com> wrote:
> I'm writing several AbstractJavaSamplerClient implementations to do some
>  remote EJB testing. I'd like to pass in a property on jmeter start up like:
>
>  ./jmeter -Jprovider_url=d3npp.foobar.com:1099

This defines a JMeter property.

>  Is there an easy way to access this property from my Sampler implementation?
>  I thought I'd be able to get a handle to it with
>
>  public SampleResult runTest(JavaSamplerContext context) {
>   String provider_url = context.getParameter("provider_url", "");

Here is the Javadoc:
"JavaSamplerContext is used to provide context information to a
JavaSamplerClient implementation. This currently consists of the
initialization parameters which were specified in the GUI. Additional
data may be accessible through JavaSamplerContext in the future."

i.e. not the same as a JMeter property.

>  But the above doesn't work (always null.)

>  Any help appreciated.

JMeterUtils.getPropDefault()

>
>  --
>  Rick R
>

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


Mime
View raw message