Implement Java request ideas in JMeter: Create a class with the framework package provided by JMeter, inherit the class Javasamplerclient override the following four methods of the class Getdefaultparameters () Runtest ( Javasamplercontext context) Setuptest (Javasamplercontext context) Teardowntest (Javasamplercontext context) The key is to construct the JMeter parameter by the Getdefaultparameters method, the parameters obtained from the JMeter, and the parameterized code is written to debug well, with the Ecipse export runnable jar method, the jar package and the dependency package are exported. Under the Ext folder of the Jemeter installation package, restart JMeter, that is, you can implement JMeter receive parameters, Call Java Script 1. Find the JMeter framework package, the following three packets are enough, jmeter3.3 cannot find another 2 packages in the JMeter installation package looking for the above Jar package Eclipse project right-import external jar Package
New Java class inheritance Javasamplerclient
Add the JDBC Jar package Java code according to the JMeter framework, write the Setup,teatdown,run method code to run at least once, no problem do the following, export the executable jar package from Eclipse, for JMeter call project right-click
This is the exported executable jar package and the dependent package folder
Import these 2 files into the following directory, JMeter expansion pack, each script has a separate folder, storage dependent package Restart JMeter, new Java request
Click Run, the database has added a new data, the script import successfully view the results tree does not see the Java request information, because the underlying is binary data, only the console can see SYSO printed information followed by the implementation of JMeter parametric entry
Implementation of Java request in JMeter log