I think there is a bug in the file

apache-jmeter-3.0-src/src/components/org/apache/jmeter/extractor/json/jsonpath/JSONPostProcessor.java


at line 163, there is the else where i goes if only one match

} else {

    // else just one value extracted

    Object obj = extractedValues.get(0);

    String objAsString =

            obj != null ? obj.toString() : ""; //$NON-NLS-1$

*     vars.put(currentRefName, *

*             objAsString); *

*     if (matchNumber < 0 && getComputeConcatenation()) {*

*         vars.put(currentRefName + ALL_SUFFIX, objAsString);*

*     }*

}


The part which set the vars  is worng it should be like the following:

} else {

    // else just one value extracted

    Object obj = extractedValues.get(0);

    String objAsString =

            obj != null ? obj.toString() : ""; //$NON-NLS-1$

*     if (matchNumber < 0 && getComputeConcatenation()) {*

*         vars.put(currentRefName + "_1", *

*                 objAsString);*

*         vars.put(currentRefName + ALL_SUFFIX, objAsString);*

*     } else {*

*         vars.put(currentRefName, *

*                 objAsString);*

*     }*

}


In this way it respect the matchNumber docs specification even if only one value is extracted.





--
"Ai sensi e per gli effetti della legge sulla tutela dei dati personali (D.lgs 196/2003), le informazioni contenute nella presente @mail sono di natura riservata e destinate ad un uso aziendale-lavorativo con esclusione di utilizzi ad uso personale; come tali, pertanto, sono riservate esclusivamente ai destinatari sopra indicati. E' proibito leggere, copiare, usare o diffondere il contenuto della presente @mail senza autorizzazione. Se avete ricevuto questa @mail per errore, siete pregati di rispedire la stessa al mittente.
Grazie"

Reply via email to