jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emir <emi...@usask.ca>
Subject Re: Running Java classes in JMeter
Date Mon, 09 Dec 2002 17:12:55 GMT
Bruno,

I tried to implement the JavaSamplerClient interface which includes 
methods I mentioned. It is the same interface that JavaSampler 
implements, but it adds method sample(), too. THis is where you found 
it, I guess. I found both JavaSampler and JavaSamplerClient in the same 
.jar file, in one of the dirs, but I looked at JavaSamplerClient only, 
because it is mentioned in the docs.

I didn't try to extend jmeter with another sampler, just to add a class 
which I could run as a test. To my understanding of the docs,
http://jakarta.apache.org/jmeter/usermanual/component_reference.html#samplers,
item 13.1.4 (Java Request),
one should implement this interface, jar up the class, copy jar into 
lib/ext and it should appear in jmeter (with restart), when you select 
Java sampler, as one of the classes in drop-down list. This is all true, 
it works, but I am confused by its sequence of operations.
To my logic, If MyJavaClass is a test class, and I have setupTest(), and 
teardownTest(), they should be run once before and after the sampling, 
and runTest() as many times as you tell the logic controller/THread 
group to do.
However, the whole class seems to be treated as a sample, and everything 
runs once per sample. THis is not very useful, when your setup is extensive.
It would be great if some jmeter guru would explain what is going on.
And there is no scenario for Java TestPlan in the docs, but there is for 
everything else. Why? It would help, even if it tells me that jmeter is 
not appropriate for my purpose.

Emir


Bruno wrote:

You seem to know a little bit about extending Jmeter (in the sense of 
adding custom samplers). This is what I'm trying to do, but it seems 
complex and/because not well documented (sorry to complain :o) ). I 
don't know about the runTest()/setupTest()/teardownTest() methods, but 
only the sample() method.

That would be great if you could explain in a few words the minimal set 
of things to do to have a dummy Java Sampler with no parameter, 
appearing in the GUI (what is mandatory, what is optionnal)?

About your request: I'm looking for the same feature. I would phrase it 
that way: I would like a unique object doing all the samples for a given 
thread (in a given test plan or thread group). Is it already available, 
or is it silly for some reason I haven't seen?

-- Bruno.

Emir wrote:


When running a Java class in JMeter is there a way to make it run 
runTest() method in a loop, instead of having a constructor, setupTest 
and teardownTest() also run for every sample?

Am I missing something or it always runs everything?

Thanks

Emir


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


Mime
View raw message