ashrafiucse opened a new pull request, #6758:
URL: https://github.com/apache/jmeter/pull/6758
## Description
Save the patterns of the `Response Assertion` under the correctly spelled
property name `Assertion.test_strings` instead of the misspelled
`Asserion.test_strings`.
For backward compatibility, the misspelled name is still accepted when a
test plan is loaded: `ResponseAssertion#setProperty` migrates a
`Asserion.test_strings` collection 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:
```xml
<collectionProp name="Asserion.test_strings">
```
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?
- New tests in `ResponseAssertionTest`:
- `testPatternsAreStoredUnderCorrectPropertyName`: patterns are stored
under `Assertion.test_strings`
- `testPatternsSavedWithMisspelledPropertyNameAreMigrated`: a
`Asserion.test_strings` collection (as saved by JMeter ≤ 5.6.3) is migrated on
`setProperty`, values preserved, legacy property gone
- `testPatternsAreAddedToMigratedValues`: patterns added afterwards end up
in the migrated collection
- All 28 `TestSaveService` load/save round-trip tests pass after renaming
the property in the shipped test plans
- Full `:src:components:test` (552 tests) and `:src:core:test` (379 tests)
suites pass
- `./gradlew classes style` passes
- Verified end-to-end against a locally built distribution: a legacy demo
JMX (`xdocs/demos/AssertionTestPlan.jmx`, still using the misspelled name)
loads with its patterns intact, and newly saved JMX files contain
`Assertion.test_strings` only
## Types of changes
- Bug fix (non-breaking change which fixes an issue)
## Checklist:
- [x] My code follows the [code style][style-guide] of this project.
- [x] I have updated the documentation accordingly. (release notes entry
added to `xdocs/changes.xml`)
[style-guide]: https://wiki.apache.org/jmeter/CodeStyleGuidelines
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]