From 65e1f9b8af90590abf31b2e652158d4d31ddf58f Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Thu, 29 Jun 2023 14:49:32 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E5=88=A0=E9=99=A4=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apache/jmeter/assertions/JSONPathAssertion.java | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/framework/sdk-parent/jmeter/src/main/java/org/apache/jmeter/assertions/JSONPathAssertion.java b/framework/sdk-parent/jmeter/src/main/java/org/apache/jmeter/assertions/JSONPathAssertion.java index 3bf10d0ca1..0dfb27a774 100644 --- a/framework/sdk-parent/jmeter/src/main/java/org/apache/jmeter/assertions/JSONPathAssertion.java +++ b/framework/sdk-parent/jmeter/src/main/java/org/apache/jmeter/assertions/JSONPathAssertion.java @@ -19,7 +19,6 @@ package org.apache.jmeter.assertions; import com.jayway.jsonpath.JsonPath; import io.metersphere.utils.DocumentUtils; -import io.metersphere.utils.LoggerUtil; import net.minidev.json.JSONArray; import net.minidev.json.JSONObject; import net.minidev.json.JSONValue; @@ -131,7 +130,6 @@ public class JSONPathAssertion extends AbstractTestElement implements Serializab private void doAssert(String jsonString) { Object value = JsonPath.read(jsonString, getJsonPath()); - LoggerUtil.info("json断言第一次拿到的值: " + value.toString()); if (!isJsonValidationBool()) { if (value instanceof JSONArray) { JSONArray arrayValue = (JSONArray) value; @@ -237,7 +235,6 @@ public class JSONPathAssertion extends AbstractTestElement implements Serializab private boolean isEquals(Object subj) { String str = DocumentUtils.objectToString(subj, decimalFormatter); - LoggerUtil.info("json断言拿到的值: " + str); if (StringUtils.equals(str,KEY_PRE)) { return false; } @@ -246,7 +243,6 @@ public class JSONPathAssertion extends AbstractTestElement implements Serializab return JMeterUtils.compilePattern(getExpectedValue()).matcher(str).matches(); } else { Pattern pattern = JMeterUtils.getPatternCache().getPattern(getExpectedValue()); - LoggerUtil.info("json断言正则表达式的结果: " + JMeterUtils.getMatcher().matches(str, pattern)); return JMeterUtils.getMatcher().matches(str, pattern); } } else { @@ -286,9 +282,6 @@ public class JSONPathAssertion extends AbstractTestElement implements Serializab try { Number number1 = NumberUtils.createBigDecimal(v1); Number number2 = NumberUtils.createBigDecimal(v2); - LoggerUtil.info("json断言的值 " + number1.toString()); - LoggerUtil.info("期望的值 " + number2.toString()); - LoggerUtil.info("json断言比较的结果: " + number1.equals(number2)); return number1.equals(number2); } catch (Exception e) { return StringUtils.equals(v1, v2); @@ -299,9 +292,6 @@ public class JSONPathAssertion extends AbstractTestElement implements Serializab try { Number number1 = NumberUtils.createBigDecimal(v1); Number number2 = NumberUtils.createBigDecimal(v2); - LoggerUtil.info("json断言的值 " + number1.toString()); - LoggerUtil.info("期望的值 " + number2.toString()); - LoggerUtil.info("json断言比较的结果: " + !number1.equals(number2)); return !number1.equals(number2); } catch (Exception e) { return !StringUtils.equals(v1, v2);