jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vladimirsitni...@apache.org
Subject [jmeter] branch master updated: Fix ConnectException normalization in TCP_TESTS
Date Wed, 02 Oct 2019 16:58:20 GMT
This is an automated email from the ASF dual-hosted git repository.

vladimirsitnikov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git


The following commit(s) were added to refs/heads/master by this push:
     new ec49c57  Fix ConnectException normalization in TCP_TESTS
ec49c57 is described below

commit ec49c57ded11fedbe124c2b2d4108a723c2b9cf5
Author: Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
AuthorDate: Wed Oct 2 19:57:01 2019 +0300

    Fix ConnectException normalization in TCP_TESTS
---
 bin/testfiles/TCP_TESTS.jmx | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/bin/testfiles/TCP_TESTS.jmx b/bin/testfiles/TCP_TESTS.jmx
index 903337e..1bfd6e8 100644
--- a/bin/testfiles/TCP_TESTS.jmx
+++ b/bin/testfiles/TCP_TESTS.jmx
@@ -388,12 +388,14 @@ vars.put(&quot;result_decoded&quot;, new String(hex.decode(prev.getResponseData(
             <stringProp name="filename"></stringProp>
             <stringProp name="cacheKey">d65ff29e-5d0c-47df-b464-e7a84fa88e66</stringProp>
             <stringProp name="script">String oldResponseMessage = prev.getResponseMessage();
-int indexOfParenthesis = oldResponseMessage.indexOf(&quot;(&quot;);
-if(indexOfParenthesis&gt;=0) {
-	// Replace &quot;java.net.ConnectException: Connection refused (Connection refused)&quot;
-	// with &quot;java.net.ConnectException: Connection refused&quot;
-	// OpenJDK 8..11 are known to produce the extra (Connection refused)
-	prev.setResponseMessage(oldResponseMessage.substring(0, indexOfParenthesis).trim());
+// In practice the exception might have lot of flavours:
+//  &quot;java.net.ConnectException: Connection refused&quot;
+//  &quot;java.net.ConnectException: Connection refused (Connection refused)&quot;
+//  &quot;java.net.ConnectException: Connection refused: refused&quot;
+// So we normalize it
+
+if (oldResponseMessage != null &amp;&amp; oldResponseMessage.contains(&quot;java.net.ConnectException:
Connection refused&quot;)) {
+    prev.setResponseMessage(&quot;java.net.ConnectException: Connection refused&quot;);
 }
 </stringProp>
           </JSR223PostProcessor>


Mime
View raw message