ruthst00 opened a new pull request, #6771:
URL: https://github.com/apache/jmeter/pull/6771

   …zer used `TRUE` as the fallback default for `jmeter.save.saveservice.url` 
instead of `FALSE`
   
   ## Description
   <!--- Provide a general summary of your changes in the Title above -->
   <!--- Describe your changes in detail here -->
   
   The property was changed to default `true` at some point around JMeter 5.0 
(as evidenced by the comment in `jmeter-batch.properties`), but this was 
apparently unintentional or was later reverted in documentation without being 
reverted in code.
   
   ### Changes Made (3 files)
   
   1. 
__`src/core/src/main/java/org/apache/jmeter/samplers/SampleSaveConfiguration.java`__
 — Changed the fallback default from `TRUE` → `FALSE` so that when 
`jmeter.save.saveservice.url` is not set, URLs are not saved (matching 
documented behavior).
   
   2. __`bin/jmeter.properties`__ — Updated the commented-out example from 
`#jmeter.save.saveservice.url=true` → `#jmeter.save.saveservice.url=false` to 
correctly document the actual default.
   
   3. __`bin/testfiles/jmeter-batch.properties`__ — Removed the now-redundant 
explicit `jmeter.save.saveservice.url=false` override and its stale "Since 
JMeter 5.0, defaults for this property is true" comment, since the code default 
is now correctly `false`.
   
   ## Motivation and Context
   <!--- Why is this change required? What problem does it solve? -->
   <!--- If it fixes an open issue, please link to the issue here. -->
   
   ### Root Cause
   
   A one-character bug in `SampleSaveConfiguration.java` — the static 
initializer used `TRUE` as the fallback default for 
`jmeter.save.saveservice.url` instead of `FALSE`:
   
   ```java
   // Before (broken):
   URL = TRUE.equalsIgnoreCase(props.getProperty(SAVE_URL_PROP, TRUE));
   
   // After (fixed):
   URL = TRUE.equalsIgnoreCase(props.getProperty(SAVE_URL_PROP, FALSE));
   ```
   
   This meant that when no `jmeter.save.saveservice.url` property was set, the 
URL was __always saved__ regardless of user intent — contradicting the 
documented default of `false` in both 
`xdocs/usermanual/properties_reference.xml` and 
`xdocs/usermanual/listeners.xml`.
   
   Fixes [#6395](https://github.com/apache/jmeter/issues/6395)
   
   ## How Has This Been Tested?
   <!--- Please describe in detail how you tested your changes. -->
   <!--- Include details of your testing environment, tests ran to see how -->
   <!--- your change affects other areas of the code, etc. -->
   
   A new test `testUrlNotSavedByDefault()` was added to 
`TestSampleSaveConfiguration.java` as a regression guard for the bug. It 
verifies two things:
   
   1. __`new SampleSaveConfiguration().saveUrl()` returns `false`__ — a fresh 
instance with no property override must not save the URL, matching the 
documented default.
   2. __`SampleSaveConfiguration.staticConfig().saveUrl()` returns `false`__ — 
the shared static configuration (used by listeners at runtime) must also 
reflect the correct default.
   
   The test works because `JMeterTestCase` loads `jmeter.properties` (which now 
has `#jmeter.save.saveservice.url=false` commented out), so the code's fallback 
default of `FALSE` applies — exactly the condition that was broken before the 
fix. Had the old `TRUE` fallback still been in place, this test would have 
failed, making it a precise regression detector.
   
   Also fixed broken tests in `TestCSVSaveService`, which had two tests 
hardcoded to the old (incorrect) default where URL was always included in CSV 
output:
   
   - __`testHeader()`__ expected the header string to contain `URL` between 
`allThreads` and `Latency`
   - __`testSample()`__ expected the result row to contain 
`https://jmeter.apache.org` at that same position
   
   
   ## Screenshots (if appropriate):
   
   ## Types of changes
   <!--- What types of changes does your code introduce? Delete as appropriate 
-->
   - Bug fix (non-breaking change which fixes an issue)
   
   ## Checklist:
   <!--- Go over all the following points, and put an `x` in all the boxes that 
apply. -->
   <!--- If you're unsure about any of these, don't hesitate to ask. We're here 
to help! -->
   - [X] My code follows the [code style][style-guide] of this project.
   - [ ] I have updated the documentation accordingly.
   
   [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]

Reply via email to