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[]) {
;
}
}