diff --git a/backend/pom.xml b/backend/pom.xml index 8e38b46fa9..bdd4e17897 100644 --- a/backend/pom.xml +++ b/backend/pom.xml @@ -158,6 +158,12 @@ + + org.apache.jmeter + ApacheJMeter_functions + ${jmeter.version} + + org.apache.dubbo diff --git a/frontend/src/business/components/api/test/model/JMX.js b/frontend/src/business/components/api/test/model/JMX.js index 952eb15b62..2b62154c07 100644 --- a/frontend/src/business/components/api/test/model/JMX.js +++ b/frontend/src/business/components/api/test/model/JMX.js @@ -275,29 +275,23 @@ export class DubboSample extends DefaultTestElement { } export class HTTPSamplerProxy extends DefaultTestElement { - constructor(testName, request) { + constructor(testName, options = {}) { super('HTTPSamplerProxy', 'HttpTestSampleGui', 'HTTPSamplerProxy', testName); - this.request = request || {}; - if (request.useEnvironment) { - this.stringProp("HTTPSampler.domain", request.domain); - this.stringProp("HTTPSampler.protocol", request.protocol); - this.stringProp("HTTPSampler.path", this.request.path); - } else { - this.stringProp("HTTPSampler.domain", this.request.hostname); - this.stringProp("HTTPSampler.protocol", this.request.protocol.split(":")[0]); - this.stringProp("HTTPSampler.path", this.request.pathname); - } - this.stringProp("HTTPSampler.method", this.request.method); - this.stringProp("HTTPSampler.contentEncoding", this.request.encoding, "UTF-8"); - if (!this.request.port) { + this.stringProp("HTTPSampler.domain", options.domain); + this.stringProp("HTTPSampler.protocol", options.protocol); + this.stringProp("HTTPSampler.path", options.path); + + this.stringProp("HTTPSampler.method", options.method); + this.stringProp("HTTPSampler.contentEncoding", options.encoding, "UTF-8"); + if (!options.port) { this.stringProp("HTTPSampler.port", ""); } else { - this.stringProp("HTTPSampler.port", this.request.port); + this.stringProp("HTTPSampler.port", options.port); } - this.boolProp("HTTPSampler.follow_redirects", this.request.follow, true); - this.boolProp("HTTPSampler.use_keepalive", this.request.keepalive, true); + this.boolProp("HTTPSampler.follow_redirects", options.follow, true); + this.boolProp("HTTPSampler.use_keepalive", options.keepalive, true); } } diff --git a/frontend/src/business/components/api/test/model/ScenarioModel.js b/frontend/src/business/components/api/test/model/ScenarioModel.js index b67de06704..145037cf7c 100644 --- a/frontend/src/business/components/api/test/model/ScenarioModel.js +++ b/frontend/src/business/components/api/test/model/ScenarioModel.js @@ -695,14 +695,14 @@ class JMXHttpRequest { request.url = 'http://' + request.url; } let url = new URL(request.url); - this.hostname = decodeURIComponent(url.hostname); + this.domain = decodeURIComponent(url.hostname); this.port = url.port; this.protocol = url.protocol.split(":")[0]; - this.pathname = this.getPostQueryParameters(request, decodeURIComponent(url.pathname)); + this.path = this.getPostQueryParameters(request, decodeURIComponent(url.pathname)); } else { + this.domain = environment.domain; this.port = environment.port; this.protocol = environment.protocol; - this.domain = environment.domain; let url = new URL(environment.protocol + "://" + environment.socket); this.path = this.getPostQueryParameters(request, decodeURIComponent(url.pathname + (request.path ? request.path : ''))); } @@ -721,7 +721,7 @@ class JMXHttpRequest { for (let i = 0; i < parameters.length; i++) { let parameter = parameters[i]; path += (parameter.name + '=' + parameter.value); - if (i != parameters.length - 1) { + if (i !== parameters.length - 1) { path += '&'; } }