Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/gradle-wrapper-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: gradle/actions/wrapper-validation@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
- uses: gradle/actions/wrapper-validation@3f131e8634966bd73d06cc69884922b02e6faf92 # v6.2.0
2 changes: 1 addition & 1 deletion bin/jmeter.properties
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ remote_hosts=127.0.0.1
#jmeter.save.saveservice.bytes=true
# Only available with HttpClient4
#jmeter.save.saveservice.sent_bytes=true
#jmeter.save.saveservice.url=true
#jmeter.save.saveservice.url=false
#jmeter.save.saveservice.filename=false
#jmeter.save.saveservice.hostname=false
#jmeter.save.saveservice.thread_counts=true
Expand Down
3 changes: 0 additions & 3 deletions bin/testfiles/jmeter-batch.properties
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ jmeter.save.saveservice.idle_time=false
jmeter.save.saveservice.connect_time=false
# Since JMeter 3.1, defaults for this property is true
jmeter.save.saveservice.sent_bytes=false
# Since JMeter 5.0, defaults for this property is true
jmeter.save.saveservice.url=false

# add some context in case tests fail (.jtl files are not compared)
jmeter.save.saveservice.responseHeaders=true
jmeter.save.saveservice.output_format=xml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ public class SampleSaveConfiguration implements Cloneable, Serializable {

SENT_BYTES = TRUE.equalsIgnoreCase(props.getProperty(SAVE_SENT_BYTES_PROP, TRUE));

URL = TRUE.equalsIgnoreCase(props.getProperty(SAVE_URL_PROP, TRUE));
URL = TRUE.equalsIgnoreCase(props.getProperty(SAVE_URL_PROP, FALSE));

FILE_NAME = TRUE.equalsIgnoreCase(props.getProperty(SAVE_FILENAME_PROP, FALSE));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,25 @@ public void testFormatter() throws Exception {
assertTrue(a.strictDateFormatter().equals(b.strictDateFormatter()), "Objects should be equal");
}

/**
* Regression test for https://github.com/apache/jmeter/issues/6395
* <p>
* {@code jmeter.save.saveservice.url} must default to {@code false}.
* Prior to the fix the fallback value in the static initializer was {@code TRUE},
* so the URL was always written to result files even when the property was absent.
*/
@Test
public void testUrlNotSavedByDefault() {
// The default SampleSaveConfiguration (no property override) must not save the URL.
SampleSaveConfiguration config = new SampleSaveConfiguration();
assertFalse(config.saveUrl(),
"saveUrl() should be false by default (jmeter.save.saveservice.url defaults to false)");

// staticConfig() must agree with the instance default.
assertFalse(SampleSaveConfiguration.staticConfig().saveUrl(),
"staticConfig().saveUrl() should be false by default");
}

@Test
// Checks that all the saveXX() and setXXX(boolean) methods are in the list
public void testSaveConfigNames() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,15 @@ public void testShortFile() throws Exception {
// if this test fails, check whether the default was intentionally changed or not
public void testHeader() {
final String HDR = "timeStamp,elapsed,label,responseCode,responseMessage,threadName,dataType,success,"
+ "failureMessage,bytes,sentBytes,grpThreads,allThreads,URL,Latency,IdleTime,Connect";
+ "failureMessage,bytes,sentBytes,grpThreads,allThreads,Latency,IdleTime,Connect";
assertEquals(HDR, CSVSaveService.printableFieldNamesToString(), "Header text has changed");
}

@Test
// sample format should not change unexpectedly
// if this test fails, check whether the default was intentionally changed or not
public void testSample() throws MalformedURLException {
final String RESULT = "1,2,3,4,5,6,7,true,,8,9,10,11,https://jmeter.apache.org,12,13,14";
final String RESULT = "1,2,3,4,5,6,7,true,,8,9,10,11,12,13,14";
SampleResult result = new SampleResult();
result.setSaveConfig(new SampleSaveConfiguration());
result.setStampAndTime(1, 2);
Expand Down