As I began to learn more about JMeter by reading the overview documentation my main question became: “how do I integrate my custom tests with JMeter?” In Michael’s case he seemed to have a somewhat heavyweight integration in which his custom project was intimately intertwined with the JMeter distribution. I set out to see if a little lightweight integration was possible.
Here is a brief summary of what I ended up doing:
- Installed a vanilla JMeter distribution on my system.
- In my own project (in a separate directory tree) I created some custom “Samplers” which extended the AbstractJavaSamplerClient interface of JMeter.
- I created a user.properties file in the current working directory from which I would launch JMeter. In the user.properties file I added “search_paths” and “user.classpath” entries which referenced the classes and supporting jars of my custom project.
- I ran JMeter and created a Test Plan. In the Test Plan I added a “Java Request” sampler. In the configuration screen for “Java Request” sampler there is a pull-down list of available samplers. My new samplers showed up in the list (by virtue of the “search_paths” entry in user.properties).