RandomDate: include end date and handle single-day ranges
Description
RandomDate now picks inclusive date ranges by delegating the day selection to a new pickRandomDay(...) helper. That method returns the single-day range immediately and otherwise calls ThreadLocalRandom.nextLong(start, end + 1) using Math.incrementExact, so the configured end date can be emitted and start == end no longer throws. The tests for __RandomDate were updated to accept both bounds and now include explicit coverage for the single-day case and for ensuring the end date eventually appears.
Motivation and Context
Fixes #6609 . The current implementation treats the end date as exclusive and blows up when both bounds are equal, which makes it impossible to configure fixed dates or truly closed intervals in test plans.
How Has This Been Tested?
-
./gradlew :src:functions:test --tests org.apache.jmeter.functions.TestTimeRandomDateFunction -
./gradlew check(fails in:src:protocol:bolt:testdue to the flakyBoltSamplerTest.should ignore invalid timeout values()timeout; unrelated to this change)Screenshots (if appropriate):
n/a
Types of changes
-
[x] Bug fix (non-breaking change which fixes an issue)
-
[ ] New feature (non-breaking change which adds functionality)
-
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
Checklist:
-
[x] My code follows the code style of this project.
-
[ ] I have updated the documentation accordingly.