This commit is contained in:
chenjianxing 2020-12-21 19:38:04 +08:00
commit 642de28841
3 changed files with 16 additions and 13 deletions

View File

@ -19,7 +19,6 @@ import org.apache.jmeter.config.ConfigTestElement;
import org.apache.jmeter.save.SaveService;
import org.apache.jmeter.testelement.TestElement;
import org.apache.jorphan.collections.HashTree;
import org.apache.jorphan.collections.ListedHashTree;
import java.util.List;
import java.util.stream.Collectors;
@ -65,9 +64,7 @@ public class MsDubboSampler extends MsTestElement {
this.getRefElement(this);
}
final HashTree testPlanTree = new ListedHashTree();
testPlanTree.add(dubboConfig());
tree.set(dubboSample(), testPlanTree);
final HashTree testPlanTree = tree.add(dubboSample());
if (CollectionUtils.isNotEmpty(hashTree)) {
hashTree.forEach(el -> {
el.toHashTree(testPlanTree, el.getHashTree(), config);
@ -115,7 +112,7 @@ public class MsDubboSampler extends MsTestElement {
private ConfigTestElement configCenter(MsConfigCenter configCenter) {
ConfigTestElement configTestElement = new ConfigTestElement();
if (configCenter != null) {
if (configCenter != null && configCenter.getProtocol() != null && configCenter.getUsername() != null && configCenter.getPassword() != null) {
Constants.setConfigCenterProtocol(configCenter.getProtocol(), configTestElement);
Constants.setConfigCenterGroup(configCenter.getGroup(), configTestElement);
Constants.setConfigCenterNamespace(configCenter.getNamespace(), configTestElement);

View File

@ -166,7 +166,11 @@
data.protocol = this.currentProtocol;
data.request = this.request;
data.request.name = data.name;
data.request.protocol = this.currentProtocol;
if (this.currentProtocol === "DUBBO" || this.currentProtocol === "dubbo://") {
data.request.protocol = "dubbo://";
} else {
data.request.protocol = this.currentProtocol;
}
data.id = data.request.id;
data.response = this.response;
},

View File

@ -77,14 +77,16 @@
this.request.method = value;
},
getProviderList() {
if (this.request.registryCenter === undefined || this.request.dubboConfig ===undefined) {
return;
let param = {};
if (this.request.registryCenter) {
param.protocol = this.request.registryCenter.protocol;
param.address = this.request.registryCenter.address;
param.group = this.request.registryCenter.group;
} else if (this.request.dubboConfig.registryCenter) {
param.protocol = this.request.dubboConfig.registryCenter.protocol;
param.address = this.request.dubboConfig.registryCenter.address;
param.group = this.request.dubboConfig.registryCenter.group;
}
let param = {
protocol: this.request.registryCenter.protocol || this.request.dubboConfig.registryCenter.protocol,
address: this.request.registryCenter.address || this.request.dubboConfig.registryCenter.address,
group: this.request.registryCenter.group || this.request.dubboConfig.registryCenter.group,
};
this.loading = true;
this.$post("/api/dubbo/providers", param).then(response => {