fix(接口自动化) 执行微调增加特殊数据保护
This commit is contained in:
parent
a3c7dbde7f
commit
cded9b1ad4
|
@ -268,26 +268,33 @@ public class ElementUtil {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private static void formatSampler(JSONObject element) {
|
||||||
|
if (element == null || StringUtils.isEmpty(element.getString("type"))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (element.get("clazzName") == null && element.getString("type").equals("TCPSampler")) {
|
||||||
|
if (element.getString("tcpPreProcessor") != null) {
|
||||||
|
JSONObject tcpPreProcessor = JSON.parseObject(element.getString("tcpPreProcessor"));
|
||||||
|
if (tcpPreProcessor != null && tcpPreProcessor.get("clazzName") == null) {
|
||||||
|
tcpPreProcessor.fluentPut("clazzName", clazzMap.get(tcpPreProcessor.getString("type")));
|
||||||
|
element.fluentPut("tcpPreProcessor", tcpPreProcessor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (element.getString("type").equals("HTTPSamplerProxy")) {
|
||||||
|
if (element.getString("authManager") != null) {
|
||||||
|
JSONObject authManager = JSON.parseObject(element.getString("authManager"));
|
||||||
|
if (authManager != null && authManager.get("clazzName") == null) {
|
||||||
|
authManager.fluentPut("clazzName", clazzMap.get(authManager.getString("type")));
|
||||||
|
element.fluentPut("authManager", authManager);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void dataFormatting(JSONArray hashTree) {
|
public static void dataFormatting(JSONArray hashTree) {
|
||||||
for (int i = 0; i < hashTree.size(); i++) {
|
for (int i = 0; i < hashTree.size(); i++) {
|
||||||
JSONObject element = hashTree.getJSONObject(i);
|
JSONObject element = hashTree.getJSONObject(i);
|
||||||
if (element != null && element.get("clazzName") == null && element.getString("type").equals("TCPSampler")) {
|
formatSampler(element);
|
||||||
if (element.getString("tcpPreProcessor") != null) {
|
|
||||||
JSONObject tcpPreProcessor = JSON.parseObject(element.getString("tcpPreProcessor"));
|
|
||||||
if (tcpPreProcessor != null && tcpPreProcessor.get("clazzName") == null) {
|
|
||||||
tcpPreProcessor.fluentPut("clazzName", clazzMap.get(tcpPreProcessor.getString("type")));
|
|
||||||
element.fluentPut("tcpPreProcessor", tcpPreProcessor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (element != null && element.getString("type").equals("HTTPSamplerProxy")) {
|
|
||||||
if (element.getString("authManager") != null) {
|
|
||||||
JSONObject authManager = JSON.parseObject(element.getString("authManager"));
|
|
||||||
if (authManager != null && authManager.get("clazzName") == null) {
|
|
||||||
authManager.fluentPut("clazzName", clazzMap.get(authManager.getString("type")));
|
|
||||||
element.fluentPut("authManager", authManager);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (element != null && element.get("clazzName") == null && clazzMap.containsKey(element.getString("type"))) {
|
if (element != null && element.get("clazzName") == null && clazzMap.containsKey(element.getString("type"))) {
|
||||||
element.fluentPut("clazzName", clazzMap.get(element.getString("type")));
|
element.fluentPut("clazzName", clazzMap.get(element.getString("type")));
|
||||||
}
|
}
|
||||||
|
@ -302,23 +309,7 @@ public class ElementUtil {
|
||||||
if (element != null && element.get("clazzName") == null && clazzMap.containsKey(element.getString("type"))) {
|
if (element != null && element.get("clazzName") == null && clazzMap.containsKey(element.getString("type"))) {
|
||||||
element.fluentPut("clazzName", clazzMap.get(element.getString("type")));
|
element.fluentPut("clazzName", clazzMap.get(element.getString("type")));
|
||||||
}
|
}
|
||||||
if (element != null && element.get("clazzName") == null && element.getString("type").equals("TCPSampler")) {
|
formatSampler(element);
|
||||||
if (element.getString("tcpPreProcessor") != null) {
|
|
||||||
JSONObject tcpPreProcessor = JSON.parseObject(element.getString("tcpPreProcessor"));
|
|
||||||
if (tcpPreProcessor != null && tcpPreProcessor.get("clazzName") == null) {
|
|
||||||
tcpPreProcessor.fluentPut("clazzName", clazzMap.get(tcpPreProcessor.getString("type")));
|
|
||||||
element.fluentPut("tcpPreProcessor", tcpPreProcessor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (element != null && element.getString("type").equals("HTTPSamplerProxy")) {
|
|
||||||
if (element.getString("authManager") != null) {
|
|
||||||
JSONObject authManager = JSON.parseObject(element.getString("authManager"));
|
|
||||||
if (authManager != null && authManager.get("clazzName") == null) {
|
|
||||||
authManager.fluentPut("clazzName", clazzMap.get(authManager.getString("type")));
|
|
||||||
element.fluentPut("authManager", authManager);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (element != null && element.containsKey("hashTree")) {
|
if (element != null && element.containsKey("hashTree")) {
|
||||||
JSONArray elementJSONArray = element.getJSONArray("hashTree");
|
JSONArray elementJSONArray = element.getJSONArray("hashTree");
|
||||||
dataFormatting(elementJSONArray);
|
dataFormatting(elementJSONArray);
|
||||||
|
|
|
@ -315,6 +315,8 @@
|
||||||
:stepReEnable="stepEnable"
|
:stepReEnable="stepEnable"
|
||||||
:message="message"
|
:message="message"
|
||||||
@openScenario="openScenario"
|
@openScenario="openScenario"
|
||||||
|
@runScenario="runDebug"
|
||||||
|
@stopScenario="stop"
|
||||||
ref="maximizeScenario"/>
|
ref="maximizeScenario"/>
|
||||||
</ms-drawer>
|
</ms-drawer>
|
||||||
<ms-change-history ref="changeHistory"/>
|
<ms-change-history ref="changeHistory"/>
|
||||||
|
|
|
@ -48,6 +48,8 @@
|
||||||
:env-map="projectEnvMap"
|
:env-map="projectEnvMap"
|
||||||
:message="message"
|
:message="message"
|
||||||
@remove="remove" @copyRow="copyRow"
|
@remove="remove" @copyRow="copyRow"
|
||||||
|
@runScenario="runScenario"
|
||||||
|
@stopScenario="stopScenario"
|
||||||
@suggestClick="suggestClick"
|
@suggestClick="suggestClick"
|
||||||
@refReload="refReload" @openScenario="openScenario"/>
|
@refReload="refReload" @openScenario="openScenario"/>
|
||||||
</span>
|
</span>
|
||||||
|
@ -874,6 +876,12 @@ export default {
|
||||||
disableAll() {
|
disableAll() {
|
||||||
this.stepEnable = false;
|
this.stepEnable = false;
|
||||||
this.stepNode();
|
this.stepNode();
|
||||||
|
},
|
||||||
|
runScenario(scenario) {
|
||||||
|
this.$emit('runScenario', scenario);
|
||||||
|
},
|
||||||
|
stopScenario(){
|
||||||
|
this.$emit('stopScenario');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue