public class WrapperJmeterDsl extends Object
In general, prefer implementing some custom builder method (and class) for a given test element, and even contribute it to JMeter DSL if the element is public, instead of using this class. This class allows you to quickly use a component, or avoid having to create a class and methods for supporting some private and very specific component.
This class provides a builder method for each type of test element to avoid using the element in incorrect test plan locations (e.g.: defining a sampler without a thread group, or nest samplers).
| Constructor and Description |
|---|
WrapperJmeterDsl() |
| Modifier and Type | Method and Description |
|---|---|
static DslControllerWrapper |
testElement(org.apache.jmeter.control.gui.AbstractControllerGui controllerGui)
Builds a test element wrapper from a controller gui component.
|
static DslSamplerWrapper |
testElement(org.apache.jmeter.samplers.gui.AbstractSamplerGui samplerGui)
Builds a test element wrapper from a sampler gui component.
|
static DslThreadGroupWrapper |
testElement(org.apache.jmeter.threads.AbstractThreadGroup threadGroup)
Builds a test element wrapper from a thread group JMeter test element.
|
static DslThreadGroupWrapper |
testElement(org.apache.jmeter.threads.gui.AbstractThreadGroupGui threadGroupGui)
Builds a test element wrapper from a thread group gui component.
|
static DslControllerWrapper |
testElement(org.apache.jmeter.control.Controller controller)
Builds a test element wrapper from a controller JMeter test element.
|
static MultiLevelTestElementWrapper |
testElement(org.apache.jmeter.gui.JMeterGUIComponent componentGui)
Builds a test element wrapper from a JMeter multi level test element (listener, assertion,
pre-/post- processors, timers or config element) gui component.
|
static DslSamplerWrapper |
testElement(org.apache.jmeter.samplers.Sampler sampler)
Builds a test element wrapper from a sampler JMeter test element.
|
static DslControllerWrapper |
testElement(String name,
org.apache.jmeter.control.gui.AbstractControllerGui controllerGui)
Same as
testElement(AbstractControllerGui) but allowing to set a name for easy
identification in reports. |
static DslSamplerWrapper |
testElement(String name,
org.apache.jmeter.samplers.gui.AbstractSamplerGui samplerGui)
Same as
testElement(AbstractSamplerGui) but allowing to set a name for easy
identification in reports. |
static DslThreadGroupWrapper |
testElement(String name,
org.apache.jmeter.threads.AbstractThreadGroup threadGroup)
Same as
testElement(AbstractThreadGroup) but allowing to set a name for easy
identification in reports. |
static DslThreadGroupWrapper |
testElement(String name,
org.apache.jmeter.threads.gui.AbstractThreadGroupGui threadGroupGui)
Same as
testElement(AbstractThreadGroupGui) but allowing to set a name for easy
identification in reports. |
static DslControllerWrapper |
testElement(String name,
org.apache.jmeter.control.Controller controller)
Same as
testElement(Controller) but allowing to set a name for easy identification in
reports. |
static MultiLevelTestElementWrapper |
testElement(String name,
org.apache.jmeter.gui.JMeterGUIComponent guiComponent)
Same as
testElement(JMeterGUIComponent) but allowing to set a name for easy
identification in reports. |
static DslSamplerWrapper |
testElement(String name,
org.apache.jmeter.samplers.Sampler sampler)
Same as
testElement(Sampler) but allowing to set a name for easy identification in
reports. |
static MultiLevelTestElementWrapper |
testElement(String name,
org.apache.jmeter.testelement.TestElement testElement)
Same as
testElement(TestElement) but allowing to set a name for easy identification in
reports. |
static MultiLevelTestElementWrapper |
testElement(org.apache.jmeter.testelement.TestElement testElement)
Builds a test element wrapper from a JMeter multi level test element (listener, assertion,
pre-/post- processors, timers or config element).
|
public static DslThreadGroupWrapper testElement(org.apache.jmeter.threads.gui.AbstractThreadGroupGui threadGroupGui)
For TestBean JMeter elements prefer using testElement(AbstractThreadGroup)
instead.
threadGroupGui - is a thread group gui component used to create the associated test
element.
You can provide a gui component with pre initialized properties, or you
can set properties in returned instance through
DslThreadGroupWrapper.prop(String, Object) method.
Consider invoking ClearGui.clearGui() before passing it
to the method in case the method sets some default values not set by
JMeterGUIComponent.createTestElement().
DslThreadGroupWrapperpublic static DslThreadGroupWrapper testElement(String name, org.apache.jmeter.threads.gui.AbstractThreadGroupGui threadGroupGui)
testElement(AbstractThreadGroupGui) but allowing to set a name for easy
identification in reports.testElement(AbstractThreadGroupGui)public static DslThreadGroupWrapper testElement(org.apache.jmeter.threads.AbstractThreadGroup threadGroup)
This method should be used, instead of testElement(AbstractThreadGroupGui), when
wrapping TestBean JMeter test elements (which always use TestBeanGUI).
This method can also be used with non TestBean instances, but, if you want to use
BaseTestElement.showInGui() or DslTestPlan.saveAsJmx(String), then you need to
set TestElement.GUI_CLASS property to the proper GUI component class path, e.g.:
elem.setProperty(TestElement.GUI_CLASS, ThreadGroupGui.class.getName().
Prefer using testElement(AbstractThreadGroupGui) for non TestBean JMeter
test elements.threadGroup - is a JMeter thread group test element to be used by the DSL in the test
plan.
You can provide a pre initialized test element, or you can set properties in
returned instance through DslThreadGroupWrapper.prop(String, Object)
method.
DslThreadGroupWrapperpublic static DslThreadGroupWrapper testElement(String name, org.apache.jmeter.threads.AbstractThreadGroup threadGroup)
testElement(AbstractThreadGroup) but allowing to set a name for easy
identification in reports.testElement(AbstractThreadGroup)public static DslSamplerWrapper testElement(org.apache.jmeter.samplers.gui.AbstractSamplerGui samplerGui)
For TestBean JMeter elements prefer using testElement(Sampler) instead.
samplerGui - is a sampler gui component used to create the associated test element.
You can provide a gui component with pre initialized properties, or you can
set properties in returned instance through
DslSamplerWrapper.prop(String, Object) method.
Consider invoking ClearGui.clearGui() before passing it to
the method in case the method sets some default values not set by
JMeterGUIComponent.createTestElement().
DslSamplerWrapperpublic static DslSamplerWrapper testElement(String name, org.apache.jmeter.samplers.gui.AbstractSamplerGui samplerGui)
testElement(AbstractSamplerGui) but allowing to set a name for easy
identification in reports.testElement(AbstractSamplerGui)public static DslSamplerWrapper testElement(org.apache.jmeter.samplers.Sampler sampler)
This method should be used, instead of testElement(AbstractSamplerGui), when wrapping
TestBean JMeter test elements (which always use TestBeanGUI).
This method can also be used with non TestBean instances, but, if you want to use
BaseTestElement.showInGui() or DslTestPlan.saveAsJmx(String), then you need to
set TestElement.GUI_CLASS property to the proper GUI component class path e.g.:
elem.setProperty(TestElement.GUI_CLASS, HttpTestSampleGui.class.getName().
Prefer using testElement(AbstractSamplerGui) for non TestBean JMeter
test elements.sampler - is a JMeter sampler test element to be used by the DSL in the test plan.
You can provide a pre initialized test element, or you can set properties in
returned instance through DslSamplerWrapper.prop(String, Object)
method.
DslSamplerWrapperpublic static DslSamplerWrapper testElement(String name, org.apache.jmeter.samplers.Sampler sampler)
testElement(Sampler) but allowing to set a name for easy identification in
reports.testElement(Sampler)public static DslControllerWrapper testElement(org.apache.jmeter.control.gui.AbstractControllerGui controllerGui)
For TestBean JMeter elements prefer using testElement(Controller) instead.
controllerGui - is a controller gui component used to create the associated test element.
You can provide a gui component with pre initialized properties, or you
can set properties in returned instance through
DslControllerWrapper.prop(String, Object) method.
Consider invoking ClearGui.clearGui() before passing it
to the method in case the method sets some default values not set by
JMeterGUIComponent.createTestElement().
DslControllerWrapperpublic static DslControllerWrapper testElement(String name, org.apache.jmeter.control.gui.AbstractControllerGui controllerGui)
testElement(AbstractControllerGui) but allowing to set a name for easy
identification in reports.testElement(AbstractControllerGui)public static DslControllerWrapper testElement(org.apache.jmeter.control.Controller controller)
This method should be used, instead of testElement(AbstractControllerGui), when
wrapping TestBean JMeter test elements (which always use TestBeanGUI).
This method can also be used with non TestBean instances, but, if you want to use
BaseTestElement.showInGui() or DslTestPlan.saveAsJmx(String), then you need to
set TestElement.GUI_CLASS property to the proper GUI component class path, e.g.:
elem.setProperty(TestElement.GUI_CLASS, IfControllerPanel.class.getName().
Prefer using testElement(AbstractControllerGui) for non TestBean JMeter
test elements.controller - is a JMeter controller test element to be used by the DSL in the test plan.
You can provide a pre initialized test element, or you can set properties in
returned instance through DslControllerWrapper.prop(String, Object)
method.
DslControllerWrapperpublic static DslControllerWrapper testElement(String name, org.apache.jmeter.control.Controller controller)
testElement(Controller) but allowing to set a name for easy identification in
reports.testElement(Controller)public static MultiLevelTestElementWrapper testElement(org.apache.jmeter.gui.JMeterGUIComponent componentGui)
For TestBean JMeter elements prefer using testElement(TestElement) instead.
componentGui - is a multi level test element (listener, assertion, pre-/post- processors,
timers or config element) gui component used to create the associated test
element.
You can provide a gui component with pre initialized properties, or you can
set properties in returned instance through
MultiLevelTestElementWrapper.prop(String, Object) method.
Consider invoking ClearGui.clearGui() before passing it
to the method in case the method sets some default values not set by
JMeterGUIComponent.createTestElement().
MultiLevelTestElementWrapperpublic static MultiLevelTestElementWrapper testElement(String name, org.apache.jmeter.gui.JMeterGUIComponent guiComponent)
testElement(JMeterGUIComponent) but allowing to set a name for easy
identification in reports.testElement(JMeterGUIComponent)public static MultiLevelTestElementWrapper testElement(org.apache.jmeter.testelement.TestElement testElement)
This method should be used, instead of testElement(JMeterGUIComponent), when wrapping
TestBean JMeter test elements (which always use TestBeanGUI).
This method can also be used with non TestBean instances, but, if you want to use
BaseTestElement.showInGui() or DslTestPlan.saveAsJmx(String), then you need to
set TestElement.GUI_CLASS property to the proper GUI component class path, e.g.:
elem.setProperty(TestElement.GUI_CLASS, RegexExtractorGui.class.getName().
Prefer using testElement(JMeterGUIComponent) for non TestBean JMeter
test elements.testElement - is a JMeter multi level test element (listener, assertion, pre-/post-
processors, timers or config element) to be used by the DSL in the test
plan.
You can provide a pre initialized test element, or you can set properties in
returned instance through
MultiLevelTestElementWrapper.prop(String, Object) method.
MultiLevelTestElementWrapperpublic static MultiLevelTestElementWrapper testElement(String name, org.apache.jmeter.testelement.TestElement testElement)
testElement(TestElement) but allowing to set a name for easy identification in
reports.testElement(TestElement)Copyright © 2023. All rights reserved.