parent
6247454d0b
commit
ea1ae44dd3
|
@ -238,18 +238,23 @@ public class MsTCPSampler extends MsTestElement {
|
|||
this.parameters.forEach(item -> {
|
||||
names.add(new StringProperty(new Integer(new Random().nextInt(1000000)).toString(), item.getName()));
|
||||
String value = item.getValue();
|
||||
value = this.formatMockValue(value);
|
||||
if(StringUtils.isNotEmpty(this.getConnectEncoding())){
|
||||
if(StringUtils.equalsIgnoreCase("utf-8",this.getConnectEncoding())){
|
||||
value = new String(value.getBytes(),StandardCharsets.UTF_8);
|
||||
}else if(StringUtils.equalsIgnoreCase("gbk",this.getConnectEncoding())){
|
||||
try {
|
||||
value = new String(value.getBytes(),"GBK");
|
||||
}catch (Exception e){
|
||||
if(StringUtils.isNotEmpty(value)){
|
||||
value = this.formatMockValue(value);
|
||||
if(StringUtils.isNotEmpty(this.getConnectEncoding())){
|
||||
if(StringUtils.equalsIgnoreCase("utf-8",this.getConnectEncoding())){
|
||||
try {
|
||||
value = new String(value.getBytes(),StandardCharsets.UTF_8);
|
||||
}catch (Exception e){
|
||||
}
|
||||
}else if(StringUtils.equalsIgnoreCase("gbk",this.getConnectEncoding())){
|
||||
try {
|
||||
value = new String(value.getBytes(),"GBK");
|
||||
}catch (Exception e){
|
||||
}
|
||||
}
|
||||
}
|
||||
threadValues.add(new StringProperty(new Integer(new Random().nextInt(1000000)).toString(), value));
|
||||
}
|
||||
threadValues.add(new StringProperty(new Integer(new Random().nextInt(1000000)).toString(), value));
|
||||
});
|
||||
}
|
||||
userParameters.setNames(new CollectionProperty(UserParameters.NAMES, names));
|
||||
|
|
|
@ -31,25 +31,33 @@
|
|||
<template v-slot:request>
|
||||
<customize-req-info :is-customize-req="isCustomizeReq" :request="request"/>
|
||||
<p class="tip">{{ $t('api_test.definition.request.req_param') }} </p>
|
||||
<legend style="width: 100%">
|
||||
|
||||
<ms-api-request-form v-if="request.protocol==='HTTP' || request.type==='HTTPSamplerProxy'"
|
||||
:isShowEnable="true"
|
||||
:referenced="true"
|
||||
:headers="request.headers "
|
||||
:is-read-only="isCompReadOnly"
|
||||
:request="request"/>
|
||||
<esb-definition v-if="showXpackCompnent&&request.esbDataStruct!=null"
|
||||
v-xpack
|
||||
:request="request"
|
||||
:showScript="false"
|
||||
:is-read-only="isCompReadOnly"
|
||||
ref="esbDefinition"/>
|
||||
<ms-tcp-basis-parameters v-if="(request.protocol==='TCP'|| request.type==='TCPSampler')&& request.esbDataStruct==null "
|
||||
:request="request"
|
||||
:is-read-only="isCompReadOnly"
|
||||
:showScript="false"/>
|
||||
<ms-sql-basis-parameters v-if="request.protocol==='SQL'|| request.type==='JDBCSampler'"
|
||||
:request="request"
|
||||
:is-read-only="isCompReadOnly"
|
||||
:showScript="false"/>
|
||||
<ms-dubbo-basis-parameters v-if="request.protocol==='DUBBO' || request.protocol==='dubbo://'|| request.type==='DubboSampler'"
|
||||
:request="request"
|
||||
:is-read-only="isCompReadOnly"
|
||||
:showScript="false"/>
|
||||
</legend>
|
||||
</template>
|
||||
<!-- 执行结果内容 -->
|
||||
<template v-slot:result>
|
||||
|
@ -192,6 +200,17 @@ export default {
|
|||
}
|
||||
return {};
|
||||
},
|
||||
isCompReadOnly(){
|
||||
if(this.request){
|
||||
if(this.request.disabled){
|
||||
return this.request.disabled;
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
displayTitle() {
|
||||
if (this.isApiImport) {
|
||||
return this.$t('api_test.automation.api_list_import');
|
||||
|
|
|
@ -11,11 +11,13 @@
|
|||
:background-color="backgroundColor"
|
||||
:title="title" v-loading="loading">
|
||||
|
||||
<jsr233-processor-content
|
||||
:jsr223-processor="jsr223Processor"
|
||||
:is-pre-processor="isPreProcessor"
|
||||
:node="node"
|
||||
:is-read-only="isReadOnly"/>
|
||||
<legend style="width: 100%">
|
||||
<jsr233-processor-content
|
||||
:jsr223-processor="jsr223Processor"
|
||||
:is-pre-processor="isPreProcessor"
|
||||
:node="node"
|
||||
:is-read-only="this.jsr223Processor.disabled"/>
|
||||
</legend>
|
||||
|
||||
</api-base-component>
|
||||
</template>
|
||||
|
|
Loading…
Reference in New Issue