JMX Include
Jmx include let you include JMX fragment in your code. This can help for Component who are not yet available in JMC.
Depend on the node type you want to include use the following Class.
Type | Class | children types |
---|---|---|
Thread Group | ThreadGroupJmxIncludeWrapper | Controllers/Samplers |
Controllers | ControllerJmxIncludeWrapper | Controllers/Samplers |
Samplers | SamplerJmxIncludeWrapper | Samplers |
Configuration Elements | ConfigElementJmxIncludeWrapper | - |
Pre-Processors | PreProcessorJmxIncludeWrapper | - |
Post-Processors | PostProcessorJmxIncludeWrapper | - |
Timers | TimerJmxIncludeWrapper | - |
Assertions | AssertionJmxIncludeWrapper | - |
Listeners | ListenerJmxIncludeWrapper | - |
Extend Wrapper
when you extend from a Wrapper class you have to annotated class with '@SuperBuilder(setterPrefix = "with", toBuilder = true)' . Full package is lombok.experimental.SuperBuilder
#
MethodsImportant Method to be used with JMX include are :
- withPath : give the resource path of JMX file.
- withParams : Input Map for parametrized file.
#
JMX FileTo have the JMX file you can save any node in Jmeter using the menu "save as Test Fragment".
#
Parameterized file.You can replace any text in JMX fragment to be replaced dynamically by code. JMC parameter have the following format ${jmc.paramname}: EX : Chose parameter name : for example "displayJMeterProperties", in JMX file replace content by ${jmc.displayJMeterProperties}
Ex:
Input parameters can be provided using withParams method, or with @JmcParam annotation when using subClass.
#
Two way are available to use JMX include.#
Using extendsExtends from the Class of your type and override method getDefaultPath to return the resource path of JMX file.
Ex :
#
Using Direct ClassTo use direct Class you can use the class of your type and give the path of JMX file.