You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by Zhihong Zhang <zh...@gmail.com> on 2009/04/04 02:54:49 UTC
Custom Sampler
I wrote a customer sampler for OAuth (a web request with signature). I can
drop my JAR in lib/ext and everything works. There is just one problem. I
have to change messages.properties to add my text there. There is no easy
way to do this. Currently, I copy the resources to my JAR and make sure my
JAR is loaded first to overwrite the one from Jmeter. Does anyone know a
better way to do this?
I think the resource should be redesigned so it's self-contained in
extensions.
Thanks!
Zhihong
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
Re: Custom Sampler
Posted by sebb <se...@gmail.com>.
On 04/04/2009, Zhihong Zhang <zh...@gmail.com> wrote:
> The sampler is a copycat of HTTP sampler, which doesn't use TestBean. I
> don't know Jmeter that well to rewrite the sampler.
Just implement TestBean - see AccessLogSampler for example.
> I noticed the JDBC sampler implements TestBean. Is there a plan to change
> all samplers to TestBean?
No.
> Thanks!
>
>
> Zhihong
>
>
>
> On 4/3/09 8:58 PM, "sebb" <se...@gmail.com> wrote:
>
> > On 04/04/2009, Zhihong Zhang <zh...@gmail.com> wrote:
> >> I wrote a customer sampler for OAuth (a web request with signature). I can
> >> drop my JAR in lib/ext and everything works. There is just one problem. I
> >> have to change messages.properties to add my text there. There is no easy
> >> way to do this. Currently, I copy the resources to my JAR and make sure my
> >> JAR is loaded first to overwrite the one from Jmeter. Does anyone know a
> >> better way to do this?
> >
> > Use a TestBean-style sampler which has its own property file(s).
> >
> >> I think the resource should be redesigned so it's self-contained in
> >> extensions.
> >
> > Patches welcome...
> >
> >> Thanks!
> >>
> >> Zhihong
> >>
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
Re: Custom Sampler
Posted by Zhihong Zhang <zh...@gmail.com>.
The sampler is a copycat of HTTP sampler, which doesn't use TestBean. I
don't know Jmeter that well to rewrite the sampler.
I noticed the JDBC sampler implements TestBean. Is there a plan to change
all samplers to TestBean?
Thanks!
Zhihong
On 4/3/09 8:58 PM, "sebb" <se...@gmail.com> wrote:
> On 04/04/2009, Zhihong Zhang <zh...@gmail.com> wrote:
>> I wrote a customer sampler for OAuth (a web request with signature). I can
>> drop my JAR in lib/ext and everything works. There is just one problem. I
>> have to change messages.properties to add my text there. There is no easy
>> way to do this. Currently, I copy the resources to my JAR and make sure my
>> JAR is loaded first to overwrite the one from Jmeter. Does anyone know a
>> better way to do this?
>
> Use a TestBean-style sampler which has its own property file(s).
>
>> I think the resource should be redesigned so it's self-contained in
>> extensions.
>
> Patches welcome...
>
>> Thanks!
>>
>> Zhihong
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
Re: Custom Sampler
Posted by sebb <se...@gmail.com>.
On 04/04/2009, Zhihong Zhang <zh...@gmail.com> wrote:
> I wrote a customer sampler for OAuth (a web request with signature). I can
> drop my JAR in lib/ext and everything works. There is just one problem. I
> have to change messages.properties to add my text there. There is no easy
> way to do this. Currently, I copy the resources to my JAR and make sure my
> JAR is loaded first to overwrite the one from Jmeter. Does anyone know a
> better way to do this?
Use a TestBean-style sampler which has its own property file(s).
> I think the resource should be redesigned so it's self-contained in
> extensions.
Patches welcome...
> Thanks!
>
> Zhihong
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org