jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fschumac...@apache.org
Subject [jmeter] branch master updated: Make sonarqube a bit happier and trigger a new build
Date Sun, 09 Aug 2020 11:46:39 GMT
This is an automated email from the ASF dual-hosted git repository.

fschumacher 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 9df1bfe  Make sonarqube a bit happier and trigger a new build
9df1bfe is described below

commit 9df1bfee31bb4b783635d0fa3dd5af881271b4d7
Author: Felix Schumacher <felix.schumacher@internetallee.de>
AuthorDate: Sun Aug 9 13:46:25 2020 +0200

    Make sonarqube a bit happier and trigger a new build
---
 .../apache/jmeter/extractor/BoundaryExtractor.java | 35 ++++++++++++++++------
 1 file changed, 26 insertions(+), 9 deletions(-)

diff --git a/src/components/src/main/java/org/apache/jmeter/extractor/BoundaryExtractor.java
b/src/components/src/main/java/org/apache/jmeter/extractor/BoundaryExtractor.java
index 26f6c9a..f11334e 100644
--- a/src/components/src/main/java/org/apache/jmeter/extractor/BoundaryExtractor.java
+++ b/src/components/src/main/java/org/apache/jmeter/extractor/BoundaryExtractor.java
@@ -203,19 +203,36 @@ public class BoundaryExtractor extends AbstractScopedTestElement implements
Post
     }
 
     private String getInputString(SampleResult result) {
-        String inputString = useUrl() ? result.getUrlAsString() // Bug 39707
-                : useHeaders() ? result.getResponseHeaders()
-                : useRequestHeaders() ? result.getRequestHeaders()
-                : useCode() ? result.getResponseCode() // Bug 43451
-                : useMessage() ? result.getResponseMessage() // Bug 43451
-                : useUnescapedBody() ? StringEscapeUtils.unescapeHtml4(result.getResponseDataAsString())
-                : useBodyAsDocument() ? Document.getTextFromDocument(result.getResponseData())
-                : result.getResponseDataAsString() // Bug 36898
-                ;
+        String inputString = chosenInput(result);
         log.debug("Input = '{}'", inputString);
         return inputString;
     }
 
+    private String chosenInput(SampleResult result) {
+        if (useUrl()) {
+            return result.getUrlAsString(); // Bug 39707;
+        }
+        if (useHeaders()) {
+            return result.getResponseHeaders();
+        }
+        if (useRequestHeaders()) {
+            return result.getRequestHeaders();
+        }
+        if (useCode()) {
+            return result.getResponseCode(); // Bug 43451
+        }
+        if (useMessage()) {
+            return result.getResponseMessage(); // Bug 43451
+        }
+        if (useUnescapedBody()) {
+            return StringEscapeUtils.unescapeHtml4(result.getResponseDataAsString());
+        }
+        if (useBodyAsDocument()) {
+            return Document.getTextFromDocument(result.getResponseData());
+        }
+        return result.getResponseDataAsString(); // Bug 36898
+    }
+
     private List<String> extract(
             String leftBoundary, String rightBoundary, int matchNumber, Stream<String>
previousResults) {
         boolean allItems = matchNumber <= 0;


Mime
View raw message