feat(性能测试): 支持选择线程组

This commit is contained in:
Captain.B 2021-03-05 16:20:15 +08:00
parent 7599c4c5fc
commit 53f173305c
1 changed files with 19 additions and 0 deletions

View File

@ -649,6 +649,25 @@ public class JmeterDocumentParser implements DocumentParser {
((List<?>) holds).remove(0);
hold = o.toString();
}
Object deleteds = context.getProperty("deleted");
String deleted = "false";
if (deleteds instanceof List) {
Object o = ((List<?>) deleteds).get(0);
((List<?>) deleteds).remove(0);
deleted = o.toString();
}
Object enableds = context.getProperty("enabled");
String enabled = "true";
if (enableds instanceof List) {
Object o = ((List<?>) enableds).get(0);
((List<?>) enableds).remove(0);
enabled = o.toString();
}
threadGroup.setAttribute("enabled", enabled);
if (BooleanUtils.toBoolean(deleted)) {
threadGroup.setAttribute("enabled", "false");
}
Element elementProp = document.createElement("elementProp");
elementProp.setAttribute("name", "ThreadGroup.main_controller");
elementProp.setAttribute("elementType", "LoopController");