Bug 60730 - JSONPostProcessor does not set _ALL variable when only one match occurs
Summary: JSONPostProcessor does not set _ALL variable when only one match occurs
Status: RESOLVED FIXED
Alias: None
Product: JMeter
Classification: Unclassified
Component: Main (show other bugs)
Version: 3.1
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-13 20:47 UTC by Rainer Jung
Modified: 2017-02-13 21:34 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rainer Jung 2017-02-13 20:47:55 UTC
The JSONPostProcessor does not set the _ALL variable when only one match occurs. The following patch fixes this:

Index: src/components/org/apache/jmeter/extractor/json/jsonpath/JSONPostProcessor.java
===================================================================
--- src/components/org/apache/jmeter/extractor/json/jsonpath/JSONPostProcessor.java     (revision 1782848)
+++ src/components/org/apache/jmeter/extractor/json/jsonpath/JSONPostProcessor.java     (working copy)
@@ -163,7 +163,7 @@
                             String suffix = (matchNumber < 0) ? "_1" : "";
                             placeObjectIntoVars(vars, currentRefName + suffix, extractedValues, 0);
                             if (matchNumber < 0 && getComputeConcatenation()) {
-                                vars.put(currentRefName + ALL_SUFFIX, vars.get(currentRefName));
+                                vars.put(currentRefName + ALL_SUFFIX, vars.get(currentRefName + suffix));
                             }
                         }
                         if (matchNumber != 0) {
Comment 1 Rainer Jung 2017-02-13 21:34:06 UTC
Fix will be part of version 3.2:

Author: rjung
Date: Mon Feb 13 21:31:47 2017
New Revision: 1782882

URL: http://svn.apache.org/viewvc?rev=1782882&view=rev
Log:
JSONPostProcessor does not set _ALL variable when only one match occurs

Bugzilla Id: 60730