refactor: " " -> StringUtils.SPACE
This commit is contained in:
parent
ef9f70a4a8
commit
8a58e449b3
|
@ -176,7 +176,7 @@ public class Document {
|
||||||
assertion.setExpectNull(false);
|
assertion.setExpectNull(false);
|
||||||
assertion.setInvert(false);
|
assertion.setInvert(false);
|
||||||
|
|
||||||
assertion.setName((StringUtils.isNotEmpty(assertionName) ? assertionName : "DocumentAssertion") + (delimiter + item.getJsonPath() + " " + getConditionStr(item, elementCondition)));
|
assertion.setName((StringUtils.isNotEmpty(assertionName) ? assertionName : "DocumentAssertion") + (delimiter + item.getJsonPath() + StringUtils.SPACE + getConditionStr(item, elementCondition)));
|
||||||
assertion.setProperty(TestElement.TEST_CLASS, JSONPathAssertion.class.getName());
|
assertion.setProperty(TestElement.TEST_CLASS, JSONPathAssertion.class.getName());
|
||||||
assertion.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("JSONPathAssertionGui"));
|
assertion.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("JSONPathAssertionGui"));
|
||||||
assertion.setJsonPath(item.getJsonPath());
|
assertion.setJsonPath(item.getJsonPath());
|
||||||
|
@ -195,7 +195,7 @@ public class Document {
|
||||||
private XMLAssertion newXMLAssertion(DocumentElement item, ElementCondition elementCondition) {
|
private XMLAssertion newXMLAssertion(DocumentElement item, ElementCondition elementCondition) {
|
||||||
XMLAssertion assertion = new XMLAssertion();
|
XMLAssertion assertion = new XMLAssertion();
|
||||||
assertion.setEnabled(true);
|
assertion.setEnabled(true);
|
||||||
assertion.setName((StringUtils.isNotEmpty(assertionName) ? assertionName : "XMLAssertion") + delimiter + (item.getJsonPath() + " " + getConditionStr(item, elementCondition)));
|
assertion.setName((StringUtils.isNotEmpty(assertionName) ? assertionName : "XMLAssertion") + delimiter + (item.getJsonPath() + StringUtils.SPACE + getConditionStr(item, elementCondition)));
|
||||||
assertion.setProperty(TestElement.TEST_CLASS, XMLAssertion.class.getName());
|
assertion.setProperty(TestElement.TEST_CLASS, XMLAssertion.class.getName());
|
||||||
assertion.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("XMLAssertionGui"));
|
assertion.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("XMLAssertionGui"));
|
||||||
assertion.setProperty(PropertyConstant.XML_PATH, item.getJsonPath());
|
assertion.setProperty(PropertyConstant.XML_PATH, item.getJsonPath());
|
||||||
|
|
|
@ -70,9 +70,9 @@ public class MsIfController extends MsTestElement {
|
||||||
|
|
||||||
public String getLabelName() {
|
public String getLabelName() {
|
||||||
if (isValid()) {
|
if (isValid()) {
|
||||||
String label = "条件控制器:" + variable + " " + operator;
|
String label = "条件控制器:" + variable + StringUtils.SPACE + operator;
|
||||||
if (StringUtils.isNotBlank(value)) {
|
if (StringUtils.isNotBlank(value)) {
|
||||||
label += " " + this.value;
|
label += StringUtils.SPACE + this.value;
|
||||||
}
|
}
|
||||||
return label;
|
return label;
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@ public class MsTransactionController extends MsTestElement {
|
||||||
|
|
||||||
public String getLabelName() {
|
public String getLabelName() {
|
||||||
if (isValid()) {
|
if (isValid()) {
|
||||||
return NAME_CN + " " + this.name;
|
return NAME_CN + StringUtils.SPACE + this.name;
|
||||||
}
|
}
|
||||||
return NAME_CN;
|
return NAME_CN;
|
||||||
}
|
}
|
||||||
|
|
|
@ -225,8 +225,8 @@ public class MsTCPSampler extends MsTestElement {
|
||||||
if (!isCustomizeReq() && config != null && config.getTcpConfig() != null) {
|
if (!isCustomizeReq() && config != null && config.getTcpConfig() != null) {
|
||||||
if (!isCustomizeReq() && config != null) {
|
if (!isCustomizeReq() && config != null) {
|
||||||
this.server = config.getTcpConfig().getServer();
|
this.server = config.getTcpConfig().getServer();
|
||||||
this.port = config.getTcpConfig().getPort() + "";
|
this.port = config.getTcpConfig().getPort() + StringUtils.EMPTY;
|
||||||
if (StringUtils.equals(this.eolByte, " ")) {
|
if (StringUtils.equals(this.eolByte, StringUtils.SPACE)) {
|
||||||
this.eolByte = "";
|
this.eolByte = "";
|
||||||
} else {
|
} else {
|
||||||
if (StringUtils.isEmpty(this.eolByte)) {
|
if (StringUtils.isEmpty(this.eolByte)) {
|
||||||
|
|
|
@ -12,6 +12,7 @@ import io.metersphere.xpack.resourcepool.engine.provider.ClientCredential;
|
||||||
import io.metersphere.xpack.resourcepool.engine.provider.KubernetesProvider;
|
import io.metersphere.xpack.resourcepool.engine.provider.KubernetesProvider;
|
||||||
import org.apache.commons.beanutils.ConstructorUtils;
|
import org.apache.commons.beanutils.ConstructorUtils;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.reflections.Reflections;
|
import org.reflections.Reflections;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
@ -55,12 +56,12 @@ public class KubernetesTestEngine extends AbstractEngine {
|
||||||
.append(JSON.toJSONString(pod.getMetadata())).append(" 】");
|
.append(JSON.toJSONString(pod.getMetadata())).append(" 】");
|
||||||
LoggerUtil.info(logMsg);
|
LoggerUtil.info(logMsg);
|
||||||
// 拼接CURL执行命令
|
// 拼接CURL执行命令
|
||||||
StringBuffer command = new StringBuffer("curl -H \"Accept: application/json\" -H \"Content-type: application/json\" -X POST -d").append(" ");
|
StringBuffer command = new StringBuffer("curl -H \"Accept: application/json\" -H \"Content-type: application/json\" -X POST -d").append(StringUtils.SPACE);
|
||||||
command.append("'").append(JSON.toJSONString(runRequest)).append("'"); // 请求参数
|
command.append("'").append(JSON.toJSONString(runRequest)).append("'"); // 请求参数
|
||||||
command.append(" ").append("--connect-timeout 30"); // 设置连接超时时间为30S
|
command.append(StringUtils.SPACE).append("--connect-timeout 30"); // 设置连接超时时间为30S
|
||||||
command.append(" ").append("--max-time 120"); // 设置请求超时时间为120S
|
command.append(StringUtils.SPACE).append("--max-time 120"); // 设置请求超时时间为120S
|
||||||
command.append(" ").append("--retry 3"); // 设置重试次数3次
|
command.append(StringUtils.SPACE).append("--retry 3"); // 设置重试次数3次
|
||||||
command.append(" ").append("http://127.0.0.1:8082/jmeter/api/start");
|
command.append(StringUtils.SPACE).append("http://127.0.0.1:8082/jmeter/api/start");
|
||||||
KubernetesApiExec.newExecWatch(client, clientCredential.getNamespace(), pod.getMetadata().getName(), command.toString());
|
KubernetesApiExec.newExecWatch(client, clientCredential.getNamespace(), pod.getMetadata().getName(), command.toString());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LoggerUtil.error("当前报告:【" + runRequest.getReportId() + "】资源:【" + runRequest.getTestId() + "】CURL失败:", e);
|
LoggerUtil.error("当前报告:【" + runRequest.getReportId() + "】资源:【" + runRequest.getTestId() + "】CURL失败:", e);
|
||||||
|
|
|
@ -6,6 +6,7 @@ import ch.qos.logback.core.UnsynchronizedAppenderBase;
|
||||||
import io.metersphere.commons.utils.DateUtils;
|
import io.metersphere.commons.utils.DateUtils;
|
||||||
import io.metersphere.commons.utils.LogUtil;
|
import io.metersphere.commons.utils.LogUtil;
|
||||||
import io.metersphere.commons.utils.FixedCapacityUtil;
|
import io.metersphere.commons.utils.FixedCapacityUtil;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
public class JMeterLoggerAppender extends UnsynchronizedAppenderBase<ILoggingEvent> {
|
public class JMeterLoggerAppender extends UnsynchronizedAppenderBase<ILoggingEvent> {
|
||||||
@Override
|
@Override
|
||||||
|
@ -13,9 +14,9 @@ public class JMeterLoggerAppender extends UnsynchronizedAppenderBase<ILoggingEve
|
||||||
try {
|
try {
|
||||||
if (!event.getLevel().levelStr.equals(LogUtil.DEBUG)) {
|
if (!event.getLevel().levelStr.equals(LogUtil.DEBUG)) {
|
||||||
StringBuffer message = new StringBuffer();
|
StringBuffer message = new StringBuffer();
|
||||||
message.append(DateUtils.getTimeStr(event.getTimeStamp())).append(" ")
|
message.append(DateUtils.getTimeStr(event.getTimeStamp())).append(StringUtils.SPACE)
|
||||||
.append(event.getLevel()).append(" ")
|
.append(event.getLevel()).append(StringUtils.SPACE)
|
||||||
.append(event.getThreadName()).append(" ")
|
.append(event.getThreadName()).append(StringUtils.SPACE)
|
||||||
.append(event.getFormattedMessage()).append("\n");
|
.append(event.getFormattedMessage()).append("\n");
|
||||||
|
|
||||||
if (event.getThrowableProxy() != null) {
|
if (event.getThrowableProxy() != null) {
|
||||||
|
|
|
@ -50,8 +50,8 @@ public class Swagger2Parser extends SwaggerAbstractParser {
|
||||||
} else {
|
} else {
|
||||||
sourceStr = getApiTestStr(source); // 导入的二进制文件转换为 String
|
sourceStr = getApiTestStr(source); // 导入的二进制文件转换为 String
|
||||||
JSONObject jsonObject = JSONUtil.parseObject(sourceStr);
|
JSONObject jsonObject = JSONUtil.parseObject(sourceStr);
|
||||||
if (jsonObject.opt("swagger") == null || jsonObject.opt("swagger") == "null" || jsonObject.opt("swagger") == " ") {
|
if (jsonObject.opt("swagger") == null || jsonObject.opt("swagger") == "null" || jsonObject.opt("swagger") == StringUtils.SPACE) {
|
||||||
if (jsonObject.opt("openapi") == null || jsonObject.opt("openapi") == "null" || jsonObject.opt("openapi") == " ") {
|
if (jsonObject.opt("openapi") == null || jsonObject.opt("openapi") == "null" || jsonObject.opt("openapi") == StringUtils.SPACE) {
|
||||||
MSException.throwException("wrong format");
|
MSException.throwException("wrong format");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,8 @@
|
||||||
|
|
||||||
package io.metersphere.api.parse.api.har.model;
|
package io.metersphere.api.parse.api.har.model;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class HarRequest {
|
public class HarRequest {
|
||||||
|
@ -47,7 +49,7 @@ public class HarRequest {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return this.method + " " + this.url + " " + this.httpVersion;
|
return this.method + StringUtils.SPACE + this.url + StringUtils.SPACE + this.httpVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,7 +104,7 @@ public class XMLUtil {
|
||||||
pattern = Pattern.compile(rgex);
|
pattern = Pattern.compile(rgex);
|
||||||
m = pattern.matcher(xml);
|
m = pattern.matcher(xml);
|
||||||
xml = m.replaceAll(" </");
|
xml = m.replaceAll(" </");
|
||||||
return Arrays.asList(xml.split(" "));
|
return Arrays.asList(xml.split(StringUtils.SPACE));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 传入预处理的列表,返回转换成功的 json 对象
|
// 传入预处理的列表,返回转换成功的 json 对象
|
||||||
|
|
|
@ -1008,7 +1008,7 @@ public class ApiTestCaseService {
|
||||||
if (nameListStr.length() > 1) {
|
if (nameListStr.length() > 1) {
|
||||||
nameListStr = nameListStr.substring(0, nameListStr.length() - 1) + "]";
|
nameListStr = nameListStr.substring(0, nameListStr.length() - 1) + "]";
|
||||||
}
|
}
|
||||||
String msg = deleteCaseName + " " + Translator.get("delete_check_reference_by") + ": " + nameListStr + " ";
|
String msg = deleteCaseName + StringUtils.SPACE + Translator.get("delete_check_reference_by") + ": " + nameListStr + StringUtils.SPACE;
|
||||||
checkMsgList.add(msg);
|
checkMsgList.add(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -568,7 +568,7 @@ public class ApiScenarioService {
|
||||||
}
|
}
|
||||||
List<ApiScenarioWithBLOBs> apiScenarioWithBLOBs = extApiScenarioMapper.listWithRefIds(ids);
|
List<ApiScenarioWithBLOBs> apiScenarioWithBLOBs = extApiScenarioMapper.listWithRefIds(ids);
|
||||||
List<String> scenarioIds = apiScenarioWithBLOBs.stream().map(ApiScenarioWithBLOBs::getId).collect(Collectors.toList());
|
List<String> scenarioIds = apiScenarioWithBLOBs.stream().map(ApiScenarioWithBLOBs::getId).collect(Collectors.toList());
|
||||||
Map<String, String> scenarioIdDefinitionMap = apiScenarioWithBLOBs.stream().collect(Collectors.toMap(ApiScenarioWithBLOBs::getId, scenario -> scenario.getScenarioDefinition() == null ? " " : scenario.getScenarioDefinition()));
|
Map<String, String> scenarioIdDefinitionMap = apiScenarioWithBLOBs.stream().collect(Collectors.toMap(ApiScenarioWithBLOBs::getId, scenario -> scenario.getScenarioDefinition() == null ? StringUtils.SPACE : scenario.getScenarioDefinition()));
|
||||||
preDelAndResource(scenarioIdDefinitionMap);
|
preDelAndResource(scenarioIdDefinitionMap);
|
||||||
|
|
||||||
TestPlanApiScenarioExample example = new TestPlanApiScenarioExample();
|
TestPlanApiScenarioExample example = new TestPlanApiScenarioExample();
|
||||||
|
@ -1941,14 +1941,14 @@ public class ApiScenarioService {
|
||||||
List<String> scenarioNames = extApiScenarioMapper.selectNameByIdIn(scenarioIdList);
|
List<String> scenarioNames = extApiScenarioMapper.selectNameByIdIn(scenarioIdList);
|
||||||
|
|
||||||
if (StringUtils.isNotEmpty(deleteScenarioName) && CollectionUtils.isNotEmpty(scenarioNames)) {
|
if (StringUtils.isNotEmpty(deleteScenarioName) && CollectionUtils.isNotEmpty(scenarioNames)) {
|
||||||
String nameListStr = " ";
|
String nameListStr = StringUtils.SPACE;
|
||||||
for (String name : scenarioNames) {
|
for (String name : scenarioNames) {
|
||||||
nameListStr += name + ",";
|
nameListStr += name + ",";
|
||||||
}
|
}
|
||||||
if (nameListStr.length() > 1) {
|
if (nameListStr.length() > 1) {
|
||||||
nameListStr = nameListStr.substring(0, nameListStr.length() - 1) + " ";
|
nameListStr = nameListStr.substring(0, nameListStr.length() - 1) + StringUtils.SPACE;
|
||||||
}
|
}
|
||||||
String msg = deleteScenarioName + " " + Translator.get("delete_check_reference_by") + ": " + nameListStr + " ";
|
String msg = deleteScenarioName + StringUtils.SPACE + Translator.get("delete_check_reference_by") + ": " + nameListStr + StringUtils.SPACE;
|
||||||
checkMsgList.add(msg);
|
checkMsgList.add(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -269,12 +269,12 @@ public class LdapService {
|
||||||
|
|
||||||
String mapAttr = (String) jsonObject.get(attr);
|
String mapAttr = (String) jsonObject.get(attr);
|
||||||
if (StringUtils.isBlank(mapAttr)) {
|
if (StringUtils.isBlank(mapAttr)) {
|
||||||
MSException.throwException(Translator.get("check_ldap_mapping") + " " + attr);
|
MSException.throwException(Translator.get("check_ldap_mapping") + StringUtils.SPACE + attr);
|
||||||
}
|
}
|
||||||
|
|
||||||
String result = dirContext.getStringAttribute(mapAttr);
|
String result = dirContext.getStringAttribute(mapAttr);
|
||||||
if (StringUtils.isBlank(result)) {
|
if (StringUtils.isBlank(result)) {
|
||||||
MSException.throwException(Translator.get("ldap_mapping_value_null") + " " + mapAttr);
|
MSException.throwException(Translator.get("ldap_mapping_value_null") + StringUtils.SPACE + mapAttr);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -4,6 +4,7 @@ package io.metersphere.controller.handler;
|
||||||
import io.metersphere.commons.utils.LogUtil;
|
import io.metersphere.commons.utils.LogUtil;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.aspectj.lang.JoinPoint;
|
import org.aspectj.lang.JoinPoint;
|
||||||
import org.aspectj.lang.annotation.AfterReturning;
|
import org.aspectj.lang.annotation.AfterReturning;
|
||||||
import org.aspectj.lang.annotation.Aspect;
|
import org.aspectj.lang.annotation.Aspect;
|
||||||
|
@ -49,13 +50,13 @@ public class WebLogAspect {
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder()
|
StringBuilder sb = new StringBuilder()
|
||||||
.append(h.getMethod()).append(": ")
|
.append(h.getMethod()).append(": ")
|
||||||
.append(h.getUrl()).append(" ")
|
.append(h.getUrl()).append(StringUtils.SPACE)
|
||||||
.append("TIME: ")
|
.append("TIME: ")
|
||||||
.append((System.currentTimeMillis() - h.getStartTime())).append("ms ");
|
.append((System.currentTimeMillis() - h.getStartTime())).append("ms ");
|
||||||
|
|
||||||
if (LogUtil.getLogger().isDebugEnabled()) {
|
if (LogUtil.getLogger().isDebugEnabled()) {
|
||||||
sb.append("ARGS: ")
|
sb.append("ARGS: ")
|
||||||
.append(Arrays.toString(h.getArgs())).append(" ")
|
.append(Arrays.toString(h.getArgs())).append(StringUtils.SPACE)
|
||||||
.append("RETURN: ")
|
.append("RETURN: ")
|
||||||
.append(ret);
|
.append(ret);
|
||||||
LogUtil.debug(sb.toString());
|
LogUtil.debug(sb.toString());
|
||||||
|
|
|
@ -398,7 +398,7 @@ public class BaseEnvironmentService extends NodeTreeService<ApiModuleDTO> {
|
||||||
criteria.andIdNotEqualTo(request.getId());
|
criteria.andIdNotEqualTo(request.getId());
|
||||||
}
|
}
|
||||||
if (apiTestEnvironmentMapper.selectByExample(example).size() > 0) {
|
if (apiTestEnvironmentMapper.selectByExample(example).size() > 0) {
|
||||||
existNames.append(" ").append(request.getName());
|
existNames.append(StringUtils.SPACE).append(request.getName());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,7 +142,7 @@ public class CommandService {
|
||||||
arguments.add("-destkeypass");
|
arguments.add("-destkeypass");
|
||||||
arguments.add("ms123...");
|
arguments.add("ms123...");
|
||||||
|
|
||||||
LoggerUtil.info("证书合并命令:", String.join(" ", arguments));
|
LoggerUtil.info("证书合并命令:", String.join(StringUtils.SPACE, arguments));
|
||||||
SystemCommand nativeCommand = new SystemCommand(destFile.getParentFile(), (Map) null);
|
SystemCommand nativeCommand = new SystemCommand(destFile.getParentFile(), (Map) null);
|
||||||
int exitVal = nativeCommand.run(arguments);
|
int exitVal = nativeCommand.run(arguments);
|
||||||
if (exitVal > 0) {
|
if (exitVal > 0) {
|
||||||
|
|
|
@ -109,7 +109,7 @@ public class XMLUtils {
|
||||||
pattern = Pattern.compile(rgex);
|
pattern = Pattern.compile(rgex);
|
||||||
m = pattern.matcher(xml);
|
m = pattern.matcher(xml);
|
||||||
xml = m.replaceAll(" </");
|
xml = m.replaceAll(" </");
|
||||||
return Arrays.asList(xml.split(" "));
|
return Arrays.asList(xml.split(StringUtils.SPACE));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 传入预处理的列表,返回转换成功的 json 对象
|
// 传入预处理的列表,返回转换成功的 json 对象
|
||||||
|
|
|
@ -50,7 +50,7 @@ public abstract class EasyExcelListener<T> extends AnalysisEventListener<T> {
|
||||||
|
|
||||||
if (!StringUtils.isEmpty(errMsg)) {
|
if (!StringUtils.isEmpty(errMsg)) {
|
||||||
ExcelErrData excelErrData = new ExcelErrData(t, rowIndex,
|
ExcelErrData excelErrData = new ExcelErrData(t, rowIndex,
|
||||||
Translator.get("number") + " " + rowIndex + " " + Translator.get("row") + Translator.get("error")
|
Translator.get("number") + org.apache.commons.lang3.StringUtils.SPACE + rowIndex + org.apache.commons.lang3.StringUtils.SPACE + Translator.get("row") + Translator.get("error")
|
||||||
+ ":" + errMsg);
|
+ ":" + errMsg);
|
||||||
errList.add(excelErrData);
|
errList.add(excelErrData);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -217,12 +217,12 @@ public class LdapService {
|
||||||
|
|
||||||
String mapAttr = (String) jsonObject.get(attr);
|
String mapAttr = (String) jsonObject.get(attr);
|
||||||
if (StringUtils.isBlank(mapAttr)) {
|
if (StringUtils.isBlank(mapAttr)) {
|
||||||
MSException.throwException(Translator.get("check_ldap_mapping") + " " + attr);
|
MSException.throwException(Translator.get("check_ldap_mapping") + StringUtils.SPACE + attr);
|
||||||
}
|
}
|
||||||
|
|
||||||
String result = dirContext.getStringAttribute(mapAttr);
|
String result = dirContext.getStringAttribute(mapAttr);
|
||||||
if (StringUtils.isBlank(result)) {
|
if (StringUtils.isBlank(result)) {
|
||||||
MSException.throwException(Translator.get("ldap_mapping_value_null") + " " + mapAttr);
|
MSException.throwException(Translator.get("ldap_mapping_value_null") + StringUtils.SPACE + mapAttr);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -212,11 +212,11 @@ public class ReflexObjectUtil {
|
||||||
} else {
|
} else {
|
||||||
String newValue = Objects.toString(column.getNewValue().toString(), "");
|
String newValue = Objects.toString(column.getNewValue().toString(), "");
|
||||||
if (StringUtils.isNotEmpty(newValue)) {
|
if (StringUtils.isNotEmpty(newValue)) {
|
||||||
column.setNewValue(newValue.replaceAll("\\n", " "));
|
column.setNewValue(newValue.replaceAll("\\n", StringUtils.SPACE));
|
||||||
}
|
}
|
||||||
String oldValue = Objects.toString(column.getOriginalValue(), "");
|
String oldValue = Objects.toString(column.getOriginalValue(), StringUtils.EMPTY);
|
||||||
if (StringUtils.isNotEmpty(oldValue)) {
|
if (StringUtils.isNotEmpty(oldValue)) {
|
||||||
column.setOriginalValue(oldValue.replaceAll("\\n", " "));
|
column.setOriginalValue(oldValue.replaceAll("\\n", StringUtils.SPACE));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
comparedColumns.add(column);
|
comparedColumns.add(column);
|
||||||
|
|
|
@ -30,6 +30,8 @@ package io.metersphere.log.utils.diff.json;
|
||||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a difference, as used in <code>Diff</code>. A difference consists of two pairs of starting and ending
|
* Represents a difference, as used in <code>Diff</code>. A difference consists of two pairs of starting and ending
|
||||||
* points, each pair representing either the "from" or the "to" collection passed to <code>Diff</code>. If an ending
|
* points, each pair representing either the "from" or the "to" collection passed to <code>Diff</code>. If an ending
|
||||||
|
@ -148,7 +150,7 @@ public class IncavaEntry {
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuffer buf = new StringBuffer();
|
StringBuffer buf = new StringBuffer();
|
||||||
buf.append("del: [" + delStart + ", " + delEnd + "]");
|
buf.append("del: [" + delStart + ", " + delEnd + "]");
|
||||||
buf.append(" ");
|
buf.append(StringUtils.SPACE);
|
||||||
buf.append("add: [" + addStart + ", " + addEnd + "]");
|
buf.append("add: [" + addStart + ", " + addEnd + "]");
|
||||||
return buf.toString();
|
return buf.toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ public class LarkNoticeSender extends AbstractNoticeSender {
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
LogUtil.info("飞书收件人: {}", userIds);
|
LogUtil.info("飞书收件人: {}", userIds);
|
||||||
context += StringUtils.join(collect, " ");
|
context += StringUtils.join(collect, StringUtils.SPACE);
|
||||||
LarkClient.send(messageDetail.getWebhook(), "消息通知: \n" + context);
|
LarkClient.send(messageDetail.getWebhook(), "消息通知: \n" + context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -221,7 +221,7 @@ public class EngineFactory {
|
||||||
if (!(Boolean) prop.get("enable")) {
|
if (!(Boolean) prop.get("enable")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
dns.append(prop.get("ip")).append(" ").append(prop.get("domain")).append("\n");
|
dns.append(prop.get("ip")).append(StringUtils.SPACE).append(prop.get("domain")).append("\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ import ch.qos.logback.core.UnsynchronizedAppenderBase;
|
||||||
import io.metersphere.commons.utils.DateUtils;
|
import io.metersphere.commons.utils.DateUtils;
|
||||||
import io.metersphere.commons.utils.LogUtil;
|
import io.metersphere.commons.utils.LogUtil;
|
||||||
import io.metersphere.code.snippet.util.FixedCapacityUtils;
|
import io.metersphere.code.snippet.util.FixedCapacityUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
|
||||||
public class JMeterLoggerAppender extends UnsynchronizedAppenderBase<ILoggingEvent> {
|
public class JMeterLoggerAppender extends UnsynchronizedAppenderBase<ILoggingEvent> {
|
||||||
|
@ -14,9 +15,9 @@ public class JMeterLoggerAppender extends UnsynchronizedAppenderBase<ILoggingEve
|
||||||
try {
|
try {
|
||||||
if (!event.getLevel().levelStr.equals(LogUtil.DEBUG)) {
|
if (!event.getLevel().levelStr.equals(LogUtil.DEBUG)) {
|
||||||
StringBuffer message = new StringBuffer();
|
StringBuffer message = new StringBuffer();
|
||||||
message.append(DateUtils.getTimeStr(event.getTimeStamp())).append(" ")
|
message.append(DateUtils.getTimeStr(event.getTimeStamp())).append(StringUtils.SPACE)
|
||||||
.append(event.getLevel()).append(" ")
|
.append(event.getLevel()).append(StringUtils.SPACE)
|
||||||
.append(event.getThreadName()).append(" ")
|
.append(event.getThreadName()).append(StringUtils.SPACE)
|
||||||
.append(event.getFormattedMessage()).append("\n");
|
.append(event.getFormattedMessage()).append("\n");
|
||||||
|
|
||||||
if (event.getThrowableProxy() != null) {
|
if (event.getThrowableProxy() != null) {
|
||||||
|
|
|
@ -364,7 +364,7 @@ public class EnterpriseTestReportService {
|
||||||
previweContent = StringUtils.replace(previweContent, "class=\"hljs-right\"", "style=\"text-align: right\"");
|
previweContent = StringUtils.replace(previweContent, "class=\"hljs-right\"", "style=\"text-align: right\"");
|
||||||
previweContent = StringUtils.replace(previweContent, "class=\"hljs-left\"", "style=\"text-align: left\"");
|
previweContent = StringUtils.replace(previweContent, "class=\"hljs-left\"", "style=\"text-align: left\"");
|
||||||
if (StringUtils.contains(previweContent, "<img src=\"/resource/md/get") && StringUtils.contains(previweContent, "\" alt=\"")) {
|
if (StringUtils.contains(previweContent, "<img src=\"/resource/md/get") && StringUtils.contains(previweContent, "\" alt=\"")) {
|
||||||
String[] previewContentArr = StringUtils.splitByWholeSeparator(" " + previweContent, "<img src=\"/resource/md/get");
|
String[] previewContentArr = StringUtils.splitByWholeSeparator(StringUtils.SPACE + previweContent, "<img src=\"/resource/md/get");
|
||||||
if (previewContentArr.length > 1) {
|
if (previewContentArr.length > 1) {
|
||||||
for (int i = 1; i < previewContentArr.length; i++) {
|
for (int i = 1; i < previewContentArr.length; i++) {
|
||||||
String itemStr = previewContentArr[i];
|
String itemStr = previewContentArr[i];
|
||||||
|
|
|
@ -50,7 +50,7 @@ public abstract class EasyExcelListener<T> extends AnalysisEventListener<T> {
|
||||||
|
|
||||||
if (!StringUtils.isEmpty(errMsg)) {
|
if (!StringUtils.isEmpty(errMsg)) {
|
||||||
ExcelErrData excelErrData = new ExcelErrData(t, rowIndex,
|
ExcelErrData excelErrData = new ExcelErrData(t, rowIndex,
|
||||||
Translator.get("number") + " " + rowIndex + " " + Translator.get("row") + Translator.get("error")
|
Translator.get("number") + org.apache.commons.lang3.StringUtils.SPACE + rowIndex + org.apache.commons.lang3.StringUtils.SPACE + Translator.get("row") + Translator.get("error")
|
||||||
+ ":" + errMsg);
|
+ ":" + errMsg);
|
||||||
errList.add(excelErrData);
|
errList.add(excelErrData);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -202,8 +202,8 @@ public class TestCaseNoModelDataListener extends AnalysisEventListener<Map<Integ
|
||||||
}
|
}
|
||||||
ExcelErrData excelErrData = new ExcelErrData(testCaseExcelData, rowIndex,
|
ExcelErrData excelErrData = new ExcelErrData(testCaseExcelData, rowIndex,
|
||||||
Translator.get("number")
|
Translator.get("number")
|
||||||
.concat(" ")
|
.concat(StringUtils.SPACE)
|
||||||
.concat(String.valueOf(errorRowIndex + 1)).concat(" ")
|
.concat(String.valueOf(errorRowIndex + 1)).concat(StringUtils.SPACE)
|
||||||
.concat(Translator.get("row"))
|
.concat(Translator.get("row"))
|
||||||
.concat(Translator.get("error"))
|
.concat(Translator.get("error"))
|
||||||
.concat(":")
|
.concat(":")
|
||||||
|
|
|
@ -2057,7 +2057,7 @@ public class TestCaseService {
|
||||||
caseName = caseName.append(testCase.getName()).append(",");
|
caseName = caseName.append(testCase.getName()).append(",");
|
||||||
}
|
}
|
||||||
String str = caseName.substring(0, caseName.length() - 1);
|
String str = caseName.substring(0, caseName.length() - 1);
|
||||||
MSException.throwException(Translator.get("related_case_del_fail_prefix") + " " + str + " " + Translator.get("related_case_del_fail_suffix"));
|
MSException.throwException(Translator.get("related_case_del_fail_prefix") + StringUtils.SPACE + str + StringUtils.SPACE + Translator.get("related_case_del_fail_suffix"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -119,11 +119,11 @@ public abstract class ZentaoClient extends BaseClient {
|
||||||
if(StringUtils.equalsIgnoreCase(getIssueResponse.getStatus(),"fail")){
|
if(StringUtils.equalsIgnoreCase(getIssueResponse.getStatus(),"fail")){
|
||||||
GetIssueResponse.Issue issue = new GetIssueResponse.Issue();
|
GetIssueResponse.Issue issue = new GetIssueResponse.Issue();
|
||||||
issue.setId(id);
|
issue.setId(id);
|
||||||
issue.setSteps(" ");
|
issue.setSteps(StringUtils.SPACE);
|
||||||
issue.setTitle(" ");
|
issue.setTitle(StringUtils.SPACE);
|
||||||
issue.setStatus("closed");
|
issue.setStatus("closed");
|
||||||
issue.setDeleted("1");
|
issue.setDeleted("1");
|
||||||
issue.setOpenedBy(" ");
|
issue.setOpenedBy(StringUtils.SPACE);
|
||||||
getIssueResponse.setData(JSON.toJSONString(issue).toString());
|
getIssueResponse.setData(JSON.toJSONString(issue).toString());
|
||||||
}
|
}
|
||||||
return JSON.parseMap(getIssueResponse.getData());
|
return JSON.parseMap(getIssueResponse.getData());
|
||||||
|
|
|
@ -56,7 +56,7 @@ public abstract class AbstractCustomFieldValidator {
|
||||||
.replace("]", "\"]")
|
.replace("]", "\"]")
|
||||||
.replace(",", "\",\"")
|
.replace(",", "\",\"")
|
||||||
.replace(",", "\",\"")
|
.replace(",", "\",\"")
|
||||||
.replace(" ", StringUtils.EMPTY);
|
.replace(StringUtils.SPACE, StringUtils.EMPTY);
|
||||||
}
|
}
|
||||||
return JSON.parseArray(value, String.class);
|
return JSON.parseArray(value, String.class);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
Loading…
Reference in New Issue