PDA

View Full Version : JMeter, Java Requests, and JUnit


mbrower
07-02-2003, 05:07 AM
I am trying to set up JMeter 1.8.1 (current stable release) to execute
Java Requests, and will ultimately be looking to have JUnit tests
executed from JMeter. To date, I have been unable to specify anything
other than the "default" SleepTest class in a Java Request, and would
appreciate any assistance.

I have created a class that implements the JavaSamplerClient
interface, as specified in section 13.1.4 of the JMeter User's Manual.
This section goes on to state that the classes that can be invoked via
a Java Request in JMeter will show up in the "classname" pull-down
menu. This menu "provides the list of all such implementations found
by JMeter in its classpath."

I have placed the jar file in JMeter's lib directory, as specified in
section 2.4.1, "JMeter's Classpath", of the JMeter User's Manual. I
have also added my jar to my system's classpath.

I the course of trying to get this working, I have also tried putting
my jar in the $JAVA_HOME/jre/lib/ext (also mentioned in section 2.4.1)
and every other directory in the JMeter install. I have tried adding
my jar to the search_paths in jmeter.properties. I have tried editing
the jmeter.bat file and explicitly referencing my jar file in the
"java" command there. Regardless, I am not seeing my class in the
"classname" pull-down menu when I add a Java Request in JMeter.

Unless there is more to it than implementing the JavaSamplerClient
interface, I am assuming my class is OK. It's mostly a pared-down
version of the SleepTest example.

Any help would be greatly appreciated.

-----
public class MySleepTest
implements JavaSamplerClient,Serializable {

public void setupTest(HashMap arguments) {
...
}

public void teardownTest(HashMap arguments) {
...
}

public SampleResult runTest(HashMap arguments) {
...
}

public MySleepTest() {
;
}

public static void main(String args[]) {
;
}
}


MyLounge.com Site Map
Forum: Cars, Cell Phone, Database, Games, Home Improvement, IT, Music, School, Sports, Web Design, Web Server, Weight Loss

The MyLounge.com forum is intended for informational use only and should not be relied upon and is not a substitute for any advice. The information contained on MyLounge.com are opinions and suggestions of members and is not a representation of the opinions of MyLounge.com. MyLounge.com does not warrant or vouch for the accuracy, completeness or usefulness of any postings or the qualifications of any person responding. Please consult a expert or seek the services of an attorney in your area for more accuracy on your specific situation. Please note that our forums also serve as mirrors to Usenet newsgroups. Many posts you see on our forums are made by newsgroup users who may not be members of MyLounge.com Term of Service