build: JMeter hashTree 升级处理
This commit is contained in:
parent
99c0b4a0a7
commit
abcafc2a34
|
@ -1,13 +1,9 @@
|
|||
package io.metersphere.api.dto.jmeter.processors;
|
||||
|
||||
import io.metersphere.plugin.annotation.PluginSubType;
|
||||
import io.metersphere.plugin.api.dto.BaseConfigDTO;
|
||||
import io.metersphere.plugin.api.dto.TestElementDTO;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.apache.jorphan.collections.HashTree;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
|
@ -16,11 +12,4 @@ public class MSJSR223Processor extends TestElementDTO {
|
|||
private String script;
|
||||
private String scriptLanguage;
|
||||
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 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() {
|
||||
DebugSampler debugSampler = new DebugSampler();
|
||||
|
|
Loading…
Reference in New Issue