Skip to content

Commit d185142

Browse files
Overloading DslVariables constructor to allow element name to be specified (#268)
Co-authored-by: andy.tarr <[email protected]>
1 parent 0f590ac commit d185142

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

jmeter-java-dsl/src/main/java/us/abstracta/jmeter/javadsl/JmeterDsl.java

+13
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,19 @@ public static DslVariables vars() {
984984
return new DslVariables();
985985
}
986986

987+
/**
988+
* Same as {@link #vars()} but allowing to set a name on the element.
989+
* <p>
990+
* The name is used to easily identify what the variables are being used for in the jmx.
991+
*
992+
* @see #vars() (String)
993+
* @since 0.22
994+
**/
995+
996+
public static DslVariables vars(String name) {
997+
return new DslVariables(name);
998+
}
999+
9871000
/**
9881001
* Builds a JSR223 Sampler which allows sampling any Java API or custom logic.
9891002
* <p>

jmeter-java-dsl/src/main/java/us/abstracta/jmeter/javadsl/core/configs/DslVariables.java

+4
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ public DslVariables() {
4242
super("User Defined Variables", ArgumentsPanel.class);
4343
}
4444

45+
public DslVariables(String name) {
46+
super(name, ArgumentsPanel.class);
47+
}
48+
4549
/**
4650
* Allows setting a JMeter thread variable.
4751
* <p>

0 commit comments

Comments
 (0)