fix(接口自动化): 导入JMX无全路径问题处理
This commit is contained in:
parent
31040c0107
commit
b101be03a0
|
@ -153,6 +153,10 @@ public class MsJmeterParser extends ApiImportAbstractParser<ScenarioImport> {
|
||||||
|
|
||||||
public String getUrl(HTTPSamplerProxy source) throws MalformedURLException {
|
public String getUrl(HTTPSamplerProxy source) throws MalformedURLException {
|
||||||
String path = source.getPath();
|
String path = source.getPath();
|
||||||
|
// Request Defaults
|
||||||
|
if (StringUtils.isEmpty(source.getDomain())) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
if (!path.startsWith("http://") && !path.startsWith("https://")) {
|
if (!path.startsWith("http://") && !path.startsWith("https://")) {
|
||||||
String domain = source.getDomain();
|
String domain = source.getDomain();
|
||||||
String protocol = source.getProtocol();
|
String protocol = source.getProtocol();
|
||||||
|
@ -214,8 +218,8 @@ public class MsJmeterParser extends ApiImportAbstractParser<ScenarioImport> {
|
||||||
samplerProxy.getBody().setKvs(keyValues);
|
samplerProxy.getBody().setKvs(keyValues);
|
||||||
}
|
}
|
||||||
samplerProxy.setProtocol(RequestType.HTTP);
|
samplerProxy.setProtocol(RequestType.HTTP);
|
||||||
samplerProxy.setConnectTimeout(source.getConnectTimeout()+"");
|
samplerProxy.setConnectTimeout(source.getConnectTimeout() + "");
|
||||||
samplerProxy.setResponseTimeout(source.getResponseTimeout()+"");
|
samplerProxy.setResponseTimeout(source.getResponseTimeout() + "");
|
||||||
samplerProxy.setPort(source.getPropertyAsString("HTTPSampler.port"));
|
samplerProxy.setPort(source.getPropertyAsString("HTTPSampler.port"));
|
||||||
samplerProxy.setDomain(source.getDomain());
|
samplerProxy.setDomain(source.getDomain());
|
||||||
if (source.getArguments() != null) {
|
if (source.getArguments() != null) {
|
||||||
|
|
Loading…
Reference in New Issue