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