You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Ben Stover <bx...@yahoo.co.uk> on 2010/10/10 08:41:02 UTC

Can I test simple function calls with JMeter?

In the past I used JMeter for testing JMS request+response based message driven beans.
This worked fine.

I wonder now wether I can use JMeter as well to test "normal" java function calls into java modules as well.

Assume I have a class myclass123 and a method 

public void mymethod2222(int parm1, String parm2) { ... }

The class is successfully compiled into a *.jar and deployed into application server.

Can I somehow create a Jmeter test which simulates the methode call by invoking a call

myclass123.mymethod2222(10011, "teststring")

How do I have to setup such a test in JMeter EXACTLY?

Thank you
Ben





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


Re: Can I test simple function calls with JMeter?

Posted by Deepak Shetty <sh...@gmail.com>.
>How do "Java Samplers and BeanShell samplers " work ?
Im not sure what exactly you are looking for here. In case of BeanShell you
create a BeanShell sampler and write whatever java  code you want ,
returning the result as you want (so you'd just invoke the Java method you
are looking to test). In case of a Java Sampler you have to implement an
interface and write the code there . You also have a Junit sampler which can
run a JUnit test concurrently (similar to JPerfUnit).

>Your statement implies that I can test java functions and classes WITHOUT
endpoint as well.
>How does that work ?
As above. However this comes down to the debate over in-container testing or
outside. My answer implies that Im firmly in favor of in-container testing
(with exceptions). However lets say your class does some DB action that
needs it to lookup a datasource. When you run this within JMeter it wont
directly work unless you mock it up.

>Hmm, does that matter for answering the quesstions?
Sure . we might recommend something else if we knew what you were actually
looking for. For e.g. if you just want to run some java Unit Tests
concurrently use TestNG. If you have a flow that you know is slow and you
need to know where the bottleneck is use a profiler like TPTP.

regards
deepak

On Sun, Oct 17, 2010 at 1:20 AM, benxs <bx...@yahoo.co.uk> wrote:

>
> > Java Samplers and BeanShell samplers can invoke java function calls.
>
> How do "Java Samplers and BeanShell samplers " work ?
> Could you give me a simple example?
>
> >In which case the starting point must be something that is accessible
> >remotely (e.g. a HTTP end point, an EJB call, a RMI call etc etc) and you
> >could test that out.
>
> Your statement implies that I can test java functions and classes WITHOUT
> endpoint as well.
> How does that work ?
>
> >Are you by chance trying to profile your application?
>
> Hmm, does that matter for answering the quesstions?
>
> Thank you for your answers.
>
> Ben
> --
> View this message in context:
> http://jmeter.512774.n5.nabble.com/Can-I-test-simple-function-calls-with-JMeter-tp3206306p3216027.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

Re: Can I test simple function calls with JMeter?

Posted by benxs <bx...@yahoo.co.uk>.
> Java Samplers and BeanShell samplers can invoke java function calls. 

How do "Java Samplers and BeanShell samplers " work ?
Could you give me a simple example?

>In which case the starting point must be something that is accessible 
>remotely (e.g. a HTTP end point, an EJB call, a RMI call etc etc) and you 
>could test that out. 

Your statement implies that I can test java functions and classes WITHOUT
endpoint as well.
How does that work ?

>Are you by chance trying to profile your application?

Hmm, does that matter for answering the quesstions?

Thank you for your answers.

Ben
-- 
View this message in context: http://jmeter.512774.n5.nabble.com/Can-I-test-simple-function-calls-with-JMeter-tp3206306p3216027.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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


Re: Can I test simple function calls with JMeter?

Posted by Deepak Shetty <sh...@gmail.com>.
Hi
Java Samplers and BeanShell samplers can invoke java function calls.

>The class is successfully compiled into a *.jar and deployed into
application server.
In which case the starting point must be something that is accessible
remotely (e.g. a HTTP end point, an EJB call, a RMI call etc etc) and you
could test that out.
Are you by chance trying to profile your application?

regards
deepak



On Sat, Oct 9, 2010 at 11:41 PM, Ben Stover <bx...@yahoo.co.uk> wrote:

> In the past I used JMeter for testing JMS request+response based message
> driven beans.
> This worked fine.
>
> I wonder now wether I can use JMeter as well to test "normal" java function
> calls into java modules as well.
>
> Assume I have a class myclass123 and a method
>
> public void mymethod2222(int parm1, String parm2) { ... }
>
> The class is successfully compiled into a *.jar and deployed into
> application server.
>
> Can I somehow create a Jmeter test which simulates the methode call by
> invoking a call
>
> myclass123.mymethod2222(10011, "teststring")
>
> How do I have to setup such a test in JMeter EXACTLY?
>
> Thank you
> Ben
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>