fix(接口自动化): 定时任务调用节点执行时 错误修复。

This commit is contained in:
fit2-zhao 2021-06-29 18:00:41 +08:00 committed by fit2-zhao
parent 3fd1f412ff
commit 160a11f42d
5 changed files with 67 additions and 61 deletions

View File

@ -306,7 +306,7 @@ public class JMeterService {
return multipartFiles; return multipartFiles;
} }
public void runTest(String testId, HashTree hashTree, String runMode, boolean isDebug, RunModeConfig config) { public void runTest(String testId, HashTree hashTree, String runMode, boolean isDebug, String userId, RunModeConfig config) {
// 获取JMX使用到的附件 // 获取JMX使用到的附件
List<Object> multipartFiles = getMultipartFiles(hashTree); List<Object> multipartFiles = getMultipartFiles(hashTree);
// 获取JAR // 获取JAR
@ -347,7 +347,12 @@ public class JMeterService {
runRequest.setDebug(isDebug); runRequest.setDebug(isDebug);
runRequest.setRunMode(runMode); runRequest.setRunMode(runMode);
runRequest.setConfig(config); runRequest.setConfig(config);
runRequest.setUserId(Objects.requireNonNull(SessionUtils.getUser()).getId()); if (SessionUtils.getUser() != null) {
runRequest.setUserId(SessionUtils.getUser().getId());
}
if (StringUtils.isNotEmpty(userId)) {
runRequest.setUserId(userId);
}
runRequest.setJmx(new MsTestPlan().getJmx(hashTree)); runRequest.setJmx(new MsTestPlan().getJmx(hashTree));
MultiValueMap<String, Object> postParameters = new LinkedMultiValueMap<>(); MultiValueMap<String, Object> postParameters = new LinkedMultiValueMap<>();
if (CollectionUtils.isEmpty(multipartFiles)) { if (CollectionUtils.isEmpty(multipartFiles)) {

View File

@ -319,7 +319,7 @@ public class ApiAutomationService {
List<ApiScenario> list = apiScenarioMapper.selectByExample(example); List<ApiScenario> list = apiScenarioMapper.selectByExample(example);
if (CollectionUtils.isNotEmpty(list)) { if (CollectionUtils.isNotEmpty(list)) {
return true; return true;
}else { } else {
return false; return false;
} }
} }
@ -601,7 +601,7 @@ public class ApiAutomationService {
} }
} }
if (http.isEnable()) { if (http.isEnable()) {
if (StringUtils.isBlank(http.getUrl()) || (http.getIsRefEnvironment()!= null && http.getIsRefEnvironment())) { if (StringUtils.isBlank(http.getUrl()) || (http.getIsRefEnvironment() != null && http.getIsRefEnvironment())) {
env.getProjectIds().add(http.getProjectId()); env.getProjectIds().add(http.getProjectId());
env.setFullUrl(false); env.setFullUrl(false);
} }
@ -633,7 +633,7 @@ public class ApiAutomationService {
// 校验是否是全路径 // 校验是否是全路径
MsHTTPSamplerProxy httpSamplerProxy = (MsHTTPSamplerProxy) tr; MsHTTPSamplerProxy httpSamplerProxy = (MsHTTPSamplerProxy) tr;
if (httpSamplerProxy.isEnable()) { if (httpSamplerProxy.isEnable()) {
if (StringUtils.isBlank(httpSamplerProxy.getUrl()) || (httpSamplerProxy.getIsRefEnvironment()!= null && httpSamplerProxy.getIsRefEnvironment())) { if (StringUtils.isBlank(httpSamplerProxy.getUrl()) || (httpSamplerProxy.getIsRefEnvironment() != null && httpSamplerProxy.getIsRefEnvironment())) {
env.getProjectIds().add(httpSamplerProxy.getProjectId()); env.getProjectIds().add(httpSamplerProxy.getProjectId());
env.setFullUrl(false); env.setFullUrl(false);
} }
@ -674,7 +674,7 @@ public class ApiAutomationService {
http.setUrl(apiDefinition.getPath()); http.setUrl(apiDefinition.getPath());
} }
if (http.isEnable()) { if (http.isEnable()) {
if (StringUtils.isBlank(http.getUrl()) || (http.getIsRefEnvironment()!= null && http.getIsRefEnvironment())) { if (StringUtils.isBlank(http.getUrl()) || (http.getIsRefEnvironment() != null && http.getIsRefEnvironment())) {
env.setFullUrl(false); env.setFullUrl(false);
env.getProjectIds().add(http.getProjectId()); env.getProjectIds().add(http.getProjectId());
} }
@ -1259,7 +1259,7 @@ public class ApiAutomationService {
try { try {
HashTree hashTree = generateHashTree(apiScenarios, request, reportIds); HashTree hashTree = generateHashTree(apiScenarios, request, reportIds);
if (request.getConfig() != null && StringUtils.isNotBlank(request.getConfig().getResourcePoolId())) { if (request.getConfig() != null && StringUtils.isNotBlank(request.getConfig().getResourcePoolId())) {
jMeterService.runTest(JSON.toJSONString(reportIds), hashTree, runMode, false, request.getConfig()); jMeterService.runTest(JSON.toJSONString(reportIds), hashTree, runMode, false, request.getUserId(), request.getConfig());
} else { } else {
jMeterService.runSerial(JSON.toJSONString(reportIds), hashTree, request.getReportId(), runMode, request.getConfig()); jMeterService.runSerial(JSON.toJSONString(reportIds), hashTree, request.getReportId(), runMode, request.getConfig());
} }
@ -1590,7 +1590,7 @@ public class ApiAutomationService {
ApiScenarioWithBLOBs apiScenarioWithBLOBs = new ApiScenarioWithBLOBs(); ApiScenarioWithBLOBs apiScenarioWithBLOBs = new ApiScenarioWithBLOBs();
BeanUtils.copyBean(apiScenarioWithBLOBs, request); BeanUtils.copyBean(apiScenarioWithBLOBs, request);
apiScenarioWithBLOBs.setUpdateTime(System.currentTimeMillis()); apiScenarioWithBLOBs.setUpdateTime(System.currentTimeMillis());
if(apiScenarioWithBLOBs.getScenarioDefinition() != null){ if (apiScenarioWithBLOBs.getScenarioDefinition() != null) {
List<ApiMethodUrlDTO> useUrl = this.parseUrl(apiScenarioWithBLOBs); List<ApiMethodUrlDTO> useUrl = this.parseUrl(apiScenarioWithBLOBs);
apiScenarioWithBLOBs.setUseUrl(JSONArray.toJSONString(useUrl)); apiScenarioWithBLOBs.setUseUrl(JSONArray.toJSONString(useUrl));
} }
@ -1817,11 +1817,11 @@ public class ApiAutomationService {
* 1.场景中复制的接口 * 1.场景中复制的接口
* 2.场景中引用/复制的案例 * 2.场景中引用/复制的案例
* 3.场景中的自定义路径与接口定义中的匹配 * 3.场景中的自定义路径与接口定义中的匹配
* * <p>
* 匹配场景中用到的路径 * 匹配场景中用到的路径
* *
* @param allScenarioInfoList 场景集合id / scenario大字段 必须有数据 * @param allScenarioInfoList 场景集合id / scenario大字段 必须有数据
* @param allEffectiveApiList 接口集合id / path 必须有数据 * @param allEffectiveApiList 接口集合id / path 必须有数据
* @return * @return
*/ */
public float countInterfaceCoverage(List<ApiScenarioWithBLOBs> allScenarioInfoList, List<ApiDefinition> allEffectiveApiList) { public float countInterfaceCoverage(List<ApiScenarioWithBLOBs> allScenarioInfoList, List<ApiDefinition> allEffectiveApiList) {
@ -1830,20 +1830,20 @@ public class ApiAutomationService {
return 100; return 100;
} }
Map<ApiMethodUrlDTO,List<String>> urlMap = new HashMap<>(); Map<ApiMethodUrlDTO, List<String>> urlMap = new HashMap<>();
for (ApiDefinition model : allEffectiveApiList) { for (ApiDefinition model : allEffectiveApiList) {
String url = model.getPath(); String url = model.getPath();
String method = model.getMethod(); String method = model.getMethod();
String id = model.getId(); String id = model.getId();
ApiMethodUrlDTO dto = new ApiMethodUrlDTO(url,method); ApiMethodUrlDTO dto = new ApiMethodUrlDTO(url, method);
if(urlMap.containsKey(dto)){ if (urlMap.containsKey(dto)) {
urlMap.get(dto).add(id); urlMap.get(dto).add(id);
}else{ } else {
List<String> list = new ArrayList<>(); List<String> list = new ArrayList<>();
list.add(id); list.add(id);
urlMap.put(dto,list); urlMap.put(dto, list);
} }
} }
@ -1854,9 +1854,9 @@ public class ApiAutomationService {
List<ApiMethodUrlDTO> urlList = new ArrayList<>(); List<ApiMethodUrlDTO> urlList = new ArrayList<>();
for (ApiScenarioWithBLOBs model : allScenarioInfoList) { for (ApiScenarioWithBLOBs model : allScenarioInfoList) {
List<ApiMethodUrlDTO> useUrl = this.getScenarioUseUrl(model); List<ApiMethodUrlDTO> useUrl = this.getScenarioUseUrl(model);
if(CollectionUtils.isNotEmpty(useUrl)){ if (CollectionUtils.isNotEmpty(useUrl)) {
for (ApiMethodUrlDTO dto :useUrl) { for (ApiMethodUrlDTO dto : useUrl) {
if(!urlList.contains(dto)){ if (!urlList.contains(dto)) {
urlList.add(dto); urlList.add(dto);
} }
} }
@ -1877,8 +1877,8 @@ public class ApiAutomationService {
} }
int allApiIdCount = 0; int allApiIdCount = 0;
for (List<String> allApiIdList:urlMap.values()){ for (List<String> allApiIdList : urlMap.values()) {
if(CollectionUtils.isNotEmpty(allApiIdList)){ if (CollectionUtils.isNotEmpty(allApiIdList)) {
allApiIdCount += allApiIdList.size(); allApiIdCount += allApiIdList.size();
} }
} }
@ -1890,8 +1890,8 @@ public class ApiAutomationService {
private List<ApiMethodUrlDTO> getScenarioUseUrl(ApiScenarioWithBLOBs model) { private List<ApiMethodUrlDTO> getScenarioUseUrl(ApiScenarioWithBLOBs model) {
List<ApiMethodUrlDTO> useUrlList = new ArrayList<>(); List<ApiMethodUrlDTO> useUrlList = new ArrayList<>();
try { try {
useUrlList = JSONArray.parseArray(model.getUseUrl(),ApiMethodUrlDTO.class); useUrlList = JSONArray.parseArray(model.getUseUrl(), ApiMethodUrlDTO.class);
}catch (Exception e){ } catch (Exception e) {
} }
return useUrlList; return useUrlList;
} }
@ -1902,9 +1902,9 @@ public class ApiAutomationService {
try { try {
String scenarioDefiniton = scenario.getScenarioDefinition(); String scenarioDefiniton = scenario.getScenarioDefinition();
JSONObject scenarioObj = JSONObject.parseObject(scenarioDefiniton); JSONObject scenarioObj = JSONObject.parseObject(scenarioDefiniton);
List<ApiMethodUrlDTO> stepUrlList = this.getMethodUrlDTOByHashTreeJsonObj(scenarioObj); List<ApiMethodUrlDTO> stepUrlList = this.getMethodUrlDTOByHashTreeJsonObj(scenarioObj);
if(CollectionUtils.isNotEmpty(stepUrlList)){ if (CollectionUtils.isNotEmpty(stepUrlList)) {
Collection unionList = CollectionUtils.union(urlList,stepUrlList); Collection unionList = CollectionUtils.union(urlList, stepUrlList);
urlList = new ArrayList<>(unionList); urlList = new ArrayList<>(unionList);
} }
} catch (Exception e) { } catch (Exception e) {
@ -1919,22 +1919,22 @@ public class ApiAutomationService {
JSONArray hashArr = obj.getJSONArray("hashTree"); JSONArray hashArr = obj.getJSONArray("hashTree");
for (int i = 0; i < hashArr.size(); i++) { for (int i = 0; i < hashArr.size(); i++) {
JSONObject elementObj = hashArr.getJSONObject(i); JSONObject elementObj = hashArr.getJSONObject(i);
if(elementObj == null){ if (elementObj == null) {
continue; continue;
} }
if (elementObj.containsKey("url") && elementObj.containsKey("method")) { if (elementObj.containsKey("url") && elementObj.containsKey("method")) {
String url = elementObj.getString("url"); String url = elementObj.getString("url");
String method = elementObj.getString("method"); String method = elementObj.getString("method");
ApiMethodUrlDTO dto = new ApiMethodUrlDTO(url,method); ApiMethodUrlDTO dto = new ApiMethodUrlDTO(url, method);
if(!returnList.contains(dto)){ if (!returnList.contains(dto)) {
returnList.add(dto); returnList.add(dto);
} }
} }
if (elementObj.containsKey("path") && elementObj.containsKey("method")) { if (elementObj.containsKey("path") && elementObj.containsKey("method")) {
String path = elementObj.getString("path"); String path = elementObj.getString("path");
String method = elementObj.getString("method"); String method = elementObj.getString("method");
ApiMethodUrlDTO dto = new ApiMethodUrlDTO(path,method); ApiMethodUrlDTO dto = new ApiMethodUrlDTO(path, method);
if(!returnList.contains(dto)){ if (!returnList.contains(dto)) {
returnList.add(dto); returnList.add(dto);
} }
} }
@ -1942,28 +1942,28 @@ public class ApiAutomationService {
if (elementObj.containsKey("id") && elementObj.containsKey("refType")) { if (elementObj.containsKey("id") && elementObj.containsKey("refType")) {
String refType = elementObj.getString("refType"); String refType = elementObj.getString("refType");
String id = elementObj.getString("id"); String id = elementObj.getString("id");
if(StringUtils.equals("CASE",refType)){ if (StringUtils.equals("CASE", refType)) {
ApiDefinition apiDefinition = apiTestCaseService.findApiUrlAndMethodById(id); ApiDefinition apiDefinition = apiTestCaseService.findApiUrlAndMethodById(id);
if(apiDefinition != null){ if (apiDefinition != null) {
ApiMethodUrlDTO dto = new ApiMethodUrlDTO(apiDefinition.getPath(),apiDefinition.getMethod()); ApiMethodUrlDTO dto = new ApiMethodUrlDTO(apiDefinition.getPath(), apiDefinition.getMethod());
if(!returnList.contains(dto)){ if (!returnList.contains(dto)) {
returnList.add(dto); returnList.add(dto);
} }
} }
}else if(StringUtils.equals("API",refType)){ } else if (StringUtils.equals("API", refType)) {
ApiDefinition apiDefinition = apiDefinitionService.selectUrlAndMethodById(id); ApiDefinition apiDefinition = apiDefinitionService.selectUrlAndMethodById(id);
if(apiDefinition != null){ if (apiDefinition != null) {
ApiMethodUrlDTO dto = new ApiMethodUrlDTO(apiDefinition.getPath(),apiDefinition.getMethod()); ApiMethodUrlDTO dto = new ApiMethodUrlDTO(apiDefinition.getPath(), apiDefinition.getMethod());
if(!returnList.contains(dto)){ if (!returnList.contains(dto)) {
returnList.add(dto); returnList.add(dto);
} }
} }
} }
} }
List<ApiMethodUrlDTO> stepUrlList = this.getMethodUrlDTOByHashTreeJsonObj(elementObj); List<ApiMethodUrlDTO> stepUrlList = this.getMethodUrlDTOByHashTreeJsonObj(elementObj);
if(CollectionUtils.isNotEmpty(stepUrlList)){ if (CollectionUtils.isNotEmpty(stepUrlList)) {
Collection unionList = CollectionUtils.union(returnList,stepUrlList); Collection unionList = CollectionUtils.union(returnList, stepUrlList);
returnList = new ArrayList<>(unionList); returnList = new ArrayList<>(unionList);
} }
} }
@ -1998,7 +1998,6 @@ public class ApiAutomationService {
} }
public ScenarioEnv getApiScenarioProjectId(String id) { public ScenarioEnv getApiScenarioProjectId(String id) {
ApiScenarioWithBLOBs scenario = apiScenarioMapper.selectByPrimaryKey(id); ApiScenarioWithBLOBs scenario = apiScenarioMapper.selectByPrimaryKey(id);
ScenarioEnv scenarioEnv = new ScenarioEnv(); ScenarioEnv scenarioEnv = new ScenarioEnv();
@ -2101,11 +2100,11 @@ public class ApiAutomationService {
public void checkApiScenarioUseUrl() { public void checkApiScenarioUseUrl() {
List<String> noUrlScenarioIdList = extApiScenarioMapper.selectIdsByUseUrlIsNull(); List<String> noUrlScenarioIdList = extApiScenarioMapper.selectIdsByUseUrlIsNull();
for (String id : noUrlScenarioIdList) { for (String id : noUrlScenarioIdList) {
try{ try {
ApiScenarioWithBLOBs scenario = apiScenarioMapper.selectByPrimaryKey(id); ApiScenarioWithBLOBs scenario = apiScenarioMapper.selectByPrimaryKey(id);
if(scenario.getUseUrl() == null){ if (scenario.getUseUrl() == null) {
List<ApiMethodUrlDTO> useUrl = this.parseUrl(scenario); List<ApiMethodUrlDTO> useUrl = this.parseUrl(scenario);
if(useUrl != null){ if (useUrl != null) {
ApiScenarioWithBLOBs updateModel = new ApiScenarioWithBLOBs(); ApiScenarioWithBLOBs updateModel = new ApiScenarioWithBLOBs();
updateModel.setId(scenario.getId()); updateModel.setId(scenario.getId());
updateModel.setUseUrl(JSONArray.toJSONString(useUrl)); updateModel.setUseUrl(JSONArray.toJSONString(useUrl));
@ -2114,7 +2113,7 @@ public class ApiAutomationService {
} }
} }
scenario = null; scenario = null;
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
@ -2130,8 +2129,8 @@ public class ApiAutomationService {
List<ApiScenarioWithBLOBs> apiScenarioList = extApiScenarioMapper.selectIds(ids); List<ApiScenarioWithBLOBs> apiScenarioList = extApiScenarioMapper.selectIds(ids);
if (CollectionUtils.isEmpty(apiScenarioList)) { if (CollectionUtils.isEmpty(apiScenarioList)) {
return returnList; return returnList;
}else { } else {
apiScenarioList.forEach(item ->{ apiScenarioList.forEach(item -> {
String testName = item.getName(); String testName = item.getName();
MsTestPlan testPlan = new MsTestPlan(); MsTestPlan testPlan = new MsTestPlan();
testPlan.setHashTree(new LinkedList<>()); testPlan.setHashTree(new LinkedList<>());
@ -2150,10 +2149,10 @@ public class ApiAutomationService {
ServiceUtils.getSelectAllIds(batchRequest, batchRequest.getCondition(), ServiceUtils.getSelectAllIds(batchRequest, batchRequest.getCondition(),
(query) -> extApiScenarioMapper.selectIdsByQuery((ApiScenarioRequest) query)); (query) -> extApiScenarioMapper.selectIdsByQuery((ApiScenarioRequest) query));
List<ApiScenarioWithBLOBs> apiScenarioList = extApiScenarioMapper.selectIds(batchRequest.getIds()); List<ApiScenarioWithBLOBs> apiScenarioList = extApiScenarioMapper.selectIds(batchRequest.getIds());
for (ApiScenarioWithBLOBs apiModel:apiScenarioList) { for (ApiScenarioWithBLOBs apiModel : apiScenarioList) {
ApiScenarioWithBLOBs newModel = apiModel; ApiScenarioWithBLOBs newModel = apiModel;
newModel.setId(UUID.randomUUID().toString()); newModel.setId(UUID.randomUUID().toString());
newModel.setName("copy_"+apiModel.getName()); newModel.setName("copy_" + apiModel.getName());
newModel.setCreateTime(System.currentTimeMillis()); newModel.setCreateTime(System.currentTimeMillis());
newModel.setNum(getNextNum(newModel.getProjectId())); newModel.setNum(getNextNum(newModel.getProjectId()));
@ -2162,7 +2161,7 @@ public class ApiAutomationService {
andProjectIdEqualTo(newModel.getProjectId()).andStatusNotEqualTo("Trash").andIdNotEqualTo(newModel.getId()); andProjectIdEqualTo(newModel.getProjectId()).andStatusNotEqualTo("Trash").andIdNotEqualTo(newModel.getId());
if (apiScenarioMapper.countByExample(example) > 0) { if (apiScenarioMapper.countByExample(example) > 0) {
continue; continue;
}else { } else {
boolean insertFlag = true; boolean insertFlag = true;
if (StringUtils.isNotBlank(newModel.getCustomNum())) { if (StringUtils.isNotBlank(newModel.getCustomNum())) {
insertFlag = false; insertFlag = false;
@ -2178,13 +2177,14 @@ public class ApiAutomationService {
boolean isCustomNumExist = true; boolean isCustomNumExist = true;
try { try {
isCustomNumExist = this.isCustomNumExist(newModel); isCustomNumExist = this.isCustomNumExist(newModel);
}catch (Exception e){} } catch (Exception e) {
}
insertFlag = !isCustomNumExist; insertFlag = !isCustomNumExist;
} }
} }
} }
if(insertFlag){ if (insertFlag) {
apiScenarioMapper.insert(newModel); apiScenarioMapper.insert(newModel);
} }
} }

View File

@ -120,7 +120,7 @@ public class ApiDefinitionService {
public List<ApiDefinitionResult> listBatch(ApiBatchRequest request) { public List<ApiDefinitionResult> listBatch(ApiBatchRequest request) {
ServiceUtils.getSelectAllIds(request, request.getCondition(), ServiceUtils.getSelectAllIds(request, request.getCondition(),
(query) -> extApiDefinitionMapper.selectIds(query)); (query) -> extApiDefinitionMapper.selectIds(query));
if(CollectionUtils.isEmpty(request.getIds())){ if (CollectionUtils.isEmpty(request.getIds())) {
return new ArrayList<>(); return new ArrayList<>();
} }
List<ApiDefinitionResult> resList = extApiDefinitionMapper.listByIds(request.getIds()); List<ApiDefinitionResult> resList = extApiDefinitionMapper.listByIds(request.getIds());
@ -279,7 +279,7 @@ public class ApiDefinitionService {
if (StringUtils.equals(request.getMethod(), "ESB")) { if (StringUtils.equals(request.getMethod(), "ESB")) {
//ESB的接口类型数据采用TCP方式去发送并将方法类型改为TCP 并修改发送数据 //ESB的接口类型数据采用TCP方式去发送并将方法类型改为TCP 并修改发送数据
request = esbApiParamService.handleEsbRequest(request); request = esbApiParamService.handleEsbRequest(request);
}else if(StringUtils.equals(request.getMethod(), "TCP")) { } else if (StringUtils.equals(request.getMethod(), "TCP")) {
request = tcpApiParamService.handleTcpRequest(request); request = tcpApiParamService.handleTcpRequest(request);
} }
final ApiDefinitionWithBLOBs test = new ApiDefinitionWithBLOBs(); final ApiDefinitionWithBLOBs test = new ApiDefinitionWithBLOBs();
@ -586,10 +586,10 @@ public class ApiDefinitionService {
} }
try{ try {
//检查TCP数据结构等其他进行处理 //检查TCP数据结构等其他进行处理
tcpApiParamService.checkTestElement(request.getTestElement()); tcpApiParamService.checkTestElement(request.getTestElement());
}catch (Exception e){ } catch (Exception e) {
} }
HashTree hashTree = request.getTestElement().generateHashTree(config); HashTree hashTree = request.getTestElement().generateHashTree(config);
@ -600,7 +600,7 @@ public class ApiDefinitionService {
// 调用执行方法 // 调用执行方法
if (request.getConfig() != null && StringUtils.isNotBlank(request.getConfig().getResourcePoolId())) { if (request.getConfig() != null && StringUtils.isNotBlank(request.getConfig().getResourcePoolId())) {
jMeterService.runTest(request.getId(), hashTree, runMode, request.getReportId() != null, request.getConfig()); jMeterService.runTest(request.getId(), hashTree, runMode, request.getReportId() != null, null, request.getConfig());
} else { } else {
jMeterService.runDefinition(request.getId(), hashTree, request.getReportId(), runMode); jMeterService.runDefinition(request.getId(), hashTree, request.getReportId(), runMode);
} }
@ -969,6 +969,7 @@ public class ApiDefinitionService {
/** /**
* 列表开关切换 * 列表开关切换
*
* @param request * @param request
*/ */
public void switchSchedule(Schedule request) { public void switchSchedule(Schedule request) {

View File

@ -29,7 +29,7 @@ public class ParallelScenarioExecTask<T> implements Callable<T> {
public T call() { public T call() {
try { try {
if (request.getConfig() != null && StringUtils.isNotBlank(request.getConfig().getResourcePoolId())) { if (request.getConfig() != null && StringUtils.isNotBlank(request.getConfig().getResourcePoolId())) {
jMeterService.runTest(id, hashTree, request.getRunMode(), false, request.getConfig()); jMeterService.runTest(id, hashTree, request.getRunMode(), false, request.getUserId(), request.getConfig());
} else { } else {
jMeterService.runSerial(id, hashTree, request.getReportId(), request.getRunMode(), request.getConfig()); jMeterService.runSerial(id, hashTree, request.getReportId(), request.getRunMode(), request.getConfig());
} }

View File

@ -35,7 +35,7 @@ public class SerialScenarioExecTask<T> implements Callable<T> {
public T call() { public T call() {
try { try {
if (request.getConfig() != null && StringUtils.isNotBlank(request.getConfig().getResourcePoolId())) { if (request.getConfig() != null && StringUtils.isNotBlank(request.getConfig().getResourcePoolId())) {
jMeterService.runTest(id, hashTree, request.getRunMode(), false, request.getConfig()); jMeterService.runTest(id, hashTree, request.getRunMode(), false, request.getUserId(), request.getConfig());
} else { } else {
jMeterService.runSerial(id, hashTree, request.getReportId(), request.getRunMode(), request.getConfig()); jMeterService.runSerial(id, hashTree, request.getReportId(), request.getRunMode(), request.getConfig());
} }