Bug 60730

Summary: JSONPostProcessor does not set _ALL variable when only one match occurs
Product: JMeter Reporter: Rainer Jung <rainer.jung>
Component: MainAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 3.1   
Target Milestone: ---   
Hardware: All   
OS: All   

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