Save Response Assertion patterns under correctly spelled property name - #6758
Save Response Assertion patterns under correctly spelled property name#6758ashrafiucse wants to merge 1 commit into
Conversation
The patterns of the Response Assertion were saved under the misspelled property name "Asserion.test_strings" (instead of "Assertion.test_strings") by all JMeter versions up to and including 5.6.3. Save the patterns under the correct name and migrate test plans saved by older versions on load, so their patterns keep working. The schematic view handles both property names, and the shipped test plans are renamed to the correct property name. Closes apache#6289
|
Hi @vlsi — I saw your compatibility concern on #6753 and want to address it here before this PR goes the same way. This PR reads both names (load-time migration in If the project prefers your middle ground — JMeter responding to two property names at the same time — I'm happy to rework this to also keep writing the legacy (Also noting #6751 is a duplicate of #6289 — this PR tracks #6289.) |
Description
Save the patterns of the
Response Assertionunder the correctly spelled property nameAssertion.test_stringsinstead of the misspelledAsserion.test_strings.For backward compatibility, the misspelled name is still accepted when a test plan is loaded:
ResponseAssertion#setPropertymigrates aAsserion.test_stringscollection on the fly by renaming it, so test plans saved by JMeter versions up to and including 5.6.3 (and by the current trunk) keep working, and their patterns are re-saved under the correct name.The schematic view (
schematic.xsl) matches both property names, so schematic rendering of old test plans is unchanged. The test plans shipped with JMeter (bin/testfiles,bin/templates,bin/examples,extras) are renamed to the correct property name.Motivation and Context
Fixes #6289
Every JMX file saved so far stores the assertion patterns under the misspelled property name:
As noted on the issue, this also breaks interoperability with tooling that generates JMX files with the correct name (e.g. the OpenAPI generator): such assertions silently match nothing when loaded by JMeter, because JMeter looks up the misspelled property only.
How Has This Been Tested?
ResponseAssertionTest:testPatternsAreStoredUnderCorrectPropertyName: patterns are stored underAssertion.test_stringstestPatternsSavedWithMisspelledPropertyNameAreMigrated: aAsserion.test_stringscollection (as saved by JMeter ≤ 5.6.3) is migrated onsetProperty, values preserved, legacy property gonetestPatternsAreAddedToMigratedValues: patterns added afterwards end up in the migrated collectionTestSaveServiceload/save round-trip tests pass after renaming the property in the shipped test plans:src:components:test(552 tests) and:src:core:test(379 tests) suites pass./gradlew classes stylepassesxdocs/demos/AssertionTestPlan.jmx, still using the misspelled name) loads with its patterns intact, and newly saved JMX files containAssertion.test_stringsonlyTypes of changes
Checklist:
xdocs/changes.xml)