Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -72,7 +72,7 @@ public class TestCaseStep extends BaseEntity {
|
||||
|
||||
/** http 请求端口号 */
|
||||
@Excel(name = "http 请求端口号")
|
||||
private String apiPort;
|
||||
private Integer apiPort;
|
||||
|
||||
/** http 请求协议(http, https) */
|
||||
@Excel(name = "http 请求协议(http, https)")
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.test.test.service;
|
||||
import com.test.test.domain.TestCaseStep;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 用例步骤Service接口
|
||||
@@ -67,5 +68,5 @@ public interface ITestCaseStepService
|
||||
* @param jmeterHomePath jmeter安装路径
|
||||
* @return 结果
|
||||
*/
|
||||
public String executeJmeterTestCaseStepById(Long id, String jmeterHomePath);
|
||||
public Map<String, String> executeJmeterTestCaseStepById(Long id, String jmeterHomePath);
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 用例步骤Service业务层处理
|
||||
@@ -106,13 +107,12 @@ public class TestCaseStepServiceImpl implements ITestCaseStepService
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public String executeJmeterTestCaseStepById(Long id, String jmeterHomePath) {
|
||||
public Map<String, String> executeJmeterTestCaseStepById(Long id, String jmeterHomePath) {
|
||||
TestCaseStep testCaseStep = testCaseStepMapper.selectTestCaseStepById(id);
|
||||
if (testCaseStep == null) {
|
||||
log.error("根据主键id:{}未查询到用例步骤计划", id);
|
||||
return null;
|
||||
}
|
||||
String result = null;
|
||||
String url = testCaseStep.getRequestUrl();
|
||||
String method = testCaseStep.getRequestMethod().toUpperCase();
|
||||
if (!method.equals("GET") && !method.equals("POST")) {
|
||||
@@ -120,9 +120,9 @@ public class TestCaseStepServiceImpl implements ITestCaseStepService
|
||||
return null;
|
||||
}
|
||||
String requestHeader = testCaseStep.getRequestHeader();
|
||||
result = JMeterUtil.getJmeterResult(id, url, Integer.parseInt(testCaseStep.getApiPort()), testCaseStep.getRequestMethod(), testCaseStep.getRequestParams(), requestHeader, jmeterHomePath);
|
||||
Map<String, String> resultMap = JMeterUtil.getJmeterResult(id, url, testCaseStep.getApiPort(), testCaseStep.getRequestMethod(), testCaseStep.getRequestParams(), requestHeader, jmeterHomePath);
|
||||
|
||||
return result;
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="requestParams != null and requestParams != ''"> and request_params = #{requestParams}</if>
|
||||
<if test="apiHttpId != null "> and api_http_id = #{apiHttpId}</if>
|
||||
<if test="apiHost != null and apiHost != ''"> and api_host = #{apiHost}</if>
|
||||
<if test="apiPort != null and apiPort != ''"> and api_port = #{apiPort}</if>
|
||||
<if test="apiPort != null "> and api_port = #{apiPort}</if>
|
||||
<if test="apiProtocol != null and apiProtocol != ''"> and api_protocol = #{apiProtocol}</if>
|
||||
<if test="sqlCommand != null and sqlCommand != ''"> and sql_command = #{sqlCommand}</if>
|
||||
<if test="count != null "> and count = #{count}</if>
|
||||
|
||||
Reference in New Issue
Block a user