取公共参数 并替换参数 @param param @return
(String param)
| 99 | * @return |
| 100 | */ |
| 101 | protected String getCommonParam(String param) { |
| 102 | if (StringUtil.isEmpty(param)) { |
| 103 | return ""; |
| 104 | } |
| 105 | Matcher m = replaceParamPattern.matcher(param);// 取公共参数正则 |
| 106 | while (m.find()) { |
| 107 | String replaceKey = m.group(1); |
| 108 | String value; |
| 109 | // 从公共参数池中获取值 |
| 110 | value = getSaveData(replaceKey); |
| 111 | // 如果公共参数池中未能找到对应的值,该用例失败。 |
| 112 | Assert.assertNotNull(value, |
| 113 | String.format("格式化参数失败,公共参数中找不到%s。", replaceKey)); |
| 114 | param = param.replace(m.group(), value); |
| 115 | } |
| 116 | return param; |
| 117 | } |
| 118 | |
| 119 | /** |
| 120 | * 获取公共数据池中的数据 |
no test coverage detected