public class TestElementParamBuilder extends Object
TestElement for easy creation of MethodParam instances.| Constructor and Description |
|---|
TestElementParamBuilder(org.apache.jmeter.testelement.TestElement testElement)
Creates an instance for a given
TestElement. |
TestElementParamBuilder(org.apache.jmeter.testelement.TestElement testElement,
String propsPrefix)
Same as
TestElementParamBuilder(TestElement) but allowing to define a common
properties prefix for the test element. |
| Modifier and Type | Method and Description |
|---|---|
MethodParam |
boolParam(String propName,
boolean defaultValue)
Gets a MethodParam representing a boolean test element property.
|
<V,T extends MethodParam> |
buildParam(String propName,
BiFunction<String,V,T> builder,
V defaultValue) |
MethodParam |
doubleParam(String propName)
Generates a MethodParam representing a double test element property.
|
MethodParam |
durationParam(String propName)
Same as
durationParam(String, Duration) but with no default value. |
MethodParam |
durationParam(String propName,
Duration defaultValue)
Gets a MethodParam representing a test element property containing a duration (in seconds).
|
MethodParam |
durationParamMillis(String propName,
Duration defaultValue)
Gets a MethodParam representing a test element property containing a duration (in
milliseconds).
|
MethodParam |
encodingParam(String propName,
Charset defaultValue)
Gets a MethodParam representing a test element property containing an encoding (Charset).
|
<T extends Enum<?> & EnumParam.EnumPropertyValue> |
enumParam(String propName,
T defaultValue)
Gets a MethodParam representing a test element property with a restricted set (enumerated) of
string values.
|
MethodParam |
floatParam(String propName)
Generates a MethodParam representing a float test element property.
|
MethodParam |
intParam(String propName)
Same as
intParam(String, Integer) but with no default value. |
MethodParam |
intParam(String propName,
Integer defaultValue)
Generates a MethodParam representing an integer test element property.
|
MethodParam |
longParam(String propName)
Same as
longParam(String, Long) but with no default value. |
MethodParam |
longParam(String propName,
Long defaultValue)
Generates a MethodParam representing a long test element property.
|
NameParam |
nameParam(String defaultName)
Generates a MethodParam representing a test element name.
|
org.apache.jmeter.testelement.property.JMeterProperty |
prop(String propName)
Gets the
JMeterProperty instance for the given test element and property name. |
MethodParam |
stringParam(String propName)
Same as
stringParam(String, String) but with no default value. |
MethodParam |
stringParam(String propName,
String defaultValue)
Gets a MethodParam for a string test element property.
|
public TestElementParamBuilder(org.apache.jmeter.testelement.TestElement testElement)
TestElement.
When creating parameters from properties names, fully qualified property names are required.
If the test element has a common prefix for properties, consider using
TestElementParamBuilder(TestElement, String) instead.
testElement - is the JMeter test element backing this parameter builder.public TestElementParamBuilder(org.apache.jmeter.testelement.TestElement testElement,
String propsPrefix)
TestElementParamBuilder(TestElement) but allowing to define a common
properties prefix for the test element.testElement - is the JMeter test element backing this parameter builder.propsPrefix - is the common prefix for all properties of the test element.TestElementParamBuilder(TestElement)public NameParam nameParam(String defaultName)
defaultName - is the default name used by the JMeter test element.public MethodParam intParam(String propName, Integer defaultValue)
propName - is the name of the property holding an integer value. For nested properties
(a property that is inside another object property) you can use the slash
character to separate the levels (eg: http_config/use_proxy).defaultValue - is the default value used by the test element for this property.UnsupportedOperationException - when no integer can be parsed from the property value.public MethodParam intParam(String propName)
intParam(String, Integer) but with no default value.propName - is the name of the property. For nested properties (a property that is inside
another object property) you can use the slash character to separate the levels
(eg: http_config/use_proxy).MethodParam instance.intParam(String, Integer)public <V,T extends MethodParam> MethodParam buildParam(String propName, BiFunction<String,V,T> builder, V defaultValue)
public org.apache.jmeter.testelement.property.JMeterProperty prop(String propName)
JMeterProperty instance for the given test element and property name.
This is useful in general to access raw values of properties, and abstract how to access them (eg: if they are nested in object properties you can easily access them using slashes)
propName - is the name of the property. For nested properties (a property that is inside
another object property) you can use the slash character to separate the levels
(eg: http_config/use_proxy).JMeterProperty instance.public MethodParam longParam(String propName, Long defaultValue)
propName - is the name of the property holding a long value. For nested properties (a
property that is inside another object property) you can use the slash
character to separate the levels (eg: http_config/use_proxy).defaultValue - is the default value used by the test element for this property.UnsupportedOperationException - when no long can be parsed from the property value.public MethodParam longParam(String propName)
longParam(String, Long) but with no default value.propName - is the name of the property holding a long value. For nested properties (a
property that is inside another object property) you can use the slash
character to separate the levels (eg: http_config/use_proxy).UnsupportedOperationException - when no long can be parsed from the property value.public MethodParam floatParam(String propName)
propName - is the name of the property holding a float value. For nested properties (a
property that is inside another object property) you can use the slash
character to separate the levels (eg: http_config/use_proxy).UnsupportedOperationException - when no float can be parsed from the property value.public MethodParam doubleParam(String propName)
propName - is the name of the property holding a double value. For nested properties (a
property that is inside another object property) you can use the slash
character to separate the levels (eg: http_config/use_proxy).UnsupportedOperationException - when no double can be parsed from the property value.public MethodParam stringParam(String propName, String defaultValue)
propName - is the name of the property. For nested properties (a property that is
inside another object property) you can use the slash character to separate
the levels (eg: http_config/use_proxy).defaultValue - the default value assigned to the JMeter test element property.MethodParam instance.public MethodParam stringParam(String propName)
stringParam(String, String) but with no default value.propName - is the name of the property. For nested properties (a property that is inside
another object property) you can use the slash character to separate the levels
(eg: http_config/use_proxy).MethodParam instance.stringParam(String, String)public MethodParam boolParam(String propName, boolean defaultValue)
propName - is the name of the property. For nested properties (a property that is
inside another object property) you can use the slash character to separate
the levels (eg: http_config/use_proxy).defaultValue - the default value assigned to the JMeter test element property.MethodParam instance.public MethodParam durationParam(String propName, Duration defaultValue)
propName - is the name of the property. For nested properties (a property that is
inside another object property) you can use the slash character to separate
the levels (eg: http_config/use_proxy).defaultValue - the default value assigned to the JMeter test element property.MethodParam instance.public MethodParam durationParam(String propName)
durationParam(String, Duration) but with no default value.propName - is the name of the property. For nested properties (a property that is inside
another object property) you can use the slash character to separate the levels
(eg: http_config/use_proxy).MethodParam instance.durationParam(String, Duration)public MethodParam durationParamMillis(String propName, Duration defaultValue)
propName - is the name of the property. For nested properties (a property that is
inside another object property) you can use the slash character to separate
the levels (eg: http_config/use_proxy).defaultValue - the default value assigned to the JMeter test element property.MethodParam instance.public <T extends Enum<?> & EnumParam.EnumPropertyValue> MethodParam enumParam(String propName, T defaultValue)
propName - is the name of the property. For nested properties (a property that is
inside another object property) you can use the slash character to separate
the levels (eg: http_config/use_proxy).defaultValue - the default value assigned to the JMeter test element property.MethodParam instance.public MethodParam encodingParam(String propName, Charset defaultValue)
propName - is the name of the property. For nested properties (a property that is
inside another object property) you can use the slash character to separate
the levels (eg: http_config/use_proxy).defaultValue - the default value assigned to the JMeter test element property.MethodParam instance.Copyright © 2024. All rights reserved.