fix(性能测试): 修复按照迭代次数没有处理线程组禁用和删除的问题

This commit is contained in:
Captain.B 2021-05-14 15:12:03 +08:00 committed by 刘瑞斌
parent 74e1b0ce90
commit 9e7df30249
1 changed files with 18 additions and 0 deletions

View File

@ -967,6 +967,24 @@ public class JmeterDocumentParser implements DocumentParser {
((List<?>) rampUps).remove(0); ((List<?>) rampUps).remove(0);
rampUp = o.toString(); rampUp = 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"); Element elementProp = document.createElement("elementProp");
elementProp.setAttribute("name", "ThreadGroup.main_controller"); elementProp.setAttribute("name", "ThreadGroup.main_controller");
elementProp.setAttribute("elementType", "LoopController"); elementProp.setAttribute("elementType", "LoopController");