build: JMeter hashTree 升级处理
This commit is contained in:
parent
99c0b4a0a7
commit
abcafc2a34
|
@ -1,13 +1,9 @@
|
||||||
package io.metersphere.api.dto.jmeter.processors;
|
package io.metersphere.api.dto.jmeter.processors;
|
||||||
|
|
||||||
import io.metersphere.plugin.annotation.PluginSubType;
|
import io.metersphere.plugin.annotation.PluginSubType;
|
||||||
import io.metersphere.plugin.api.dto.BaseConfigDTO;
|
|
||||||
import io.metersphere.plugin.api.dto.TestElementDTO;
|
import io.metersphere.plugin.api.dto.TestElementDTO;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import org.apache.jorphan.collections.HashTree;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ -16,11 +12,4 @@ public class MSJSR223Processor extends TestElementDTO {
|
||||||
private String script;
|
private String script;
|
||||||
private String scriptLanguage;
|
private String scriptLanguage;
|
||||||
private Boolean jsrEnable;
|
private Boolean jsrEnable;
|
||||||
|
|
||||||
@Override
|
|
||||||
public void toHashTree(HashTree tree, List<TestElementDTO> hashTree, BaseConfigDTO baseConfig) {
|
|
||||||
if (!this.isEnable()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,23 +22,6 @@ public class MSDebugSampler extends TestElementDTO {
|
||||||
private boolean displayJMeterVariables = true;
|
private boolean displayJMeterVariables = true;
|
||||||
private boolean displaySystemProperties = false;
|
private boolean displaySystemProperties = false;
|
||||||
|
|
||||||
@Override
|
|
||||||
public void toHashTree(HashTree tree, List<TestElementDTO> hashTree, BaseConfigDTO configDTO) {
|
|
||||||
BaseConfigDTO config = (BaseConfigDTO) configDTO;
|
|
||||||
// 非导出操作,且不是启用状态则跳过执行
|
|
||||||
if (!this.isEnable()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
final HashTree groupTree = tree.add(debugSampler());
|
|
||||||
if (CollectionUtils.isNotEmpty(hashTree)) {
|
|
||||||
hashTree.forEach(el -> {
|
|
||||||
// 给所有孩子加一个父亲标志
|
|
||||||
el.setParent(this);
|
|
||||||
el.toHashTree(groupTree, el.getHashTree(), config);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private DebugSampler debugSampler() {
|
private DebugSampler debugSampler() {
|
||||||
DebugSampler debugSampler = new DebugSampler();
|
DebugSampler debugSampler = new DebugSampler();
|
||||||
|
|
Loading…
Reference in New Issue