Summary: | CSV Data Set Config changes slash in filename path into backslash | ||
---|---|---|---|
Product: | JMeter - Now in Github | Reporter: | Benny van Wijngaarden <benny> |
Component: | Main | Assignee: | JMeter issues mailing list <issues> |
Status: | RESOLVED FIXED | ||
Severity: | major | CC: | p.mouawad, toh2526 |
Priority: | P2 | Keywords: | FixedInTrunk |
Version: | 4.0 | ||
Target Milestone: | JMETER_5.0 | ||
Hardware: | PC | ||
OS: | All | ||
Attachments: | Store filename as string not as a file |
Description
Benny van Wijngaarden
2018-02-23 07:29:21 UTC
Possible workaround: enclose the Filename path string in a BeanShell function. Example: ${__BeanShell("testdata/myfile.csv")} This leaves the string untouched when the Test Plan is saved. Hello, What is your java version ? Also is it OpenJDK or Oracle ? Thanks We use C:\Program Files (x86)\IBM\WebSphere\AppServer-85\java_1.8_64 to start JMeter Hello, Can you try with last Oracle JDK 8 ? Thanks I did, same behaviour That behaviour is because of the File#getPath converts the path separators under Windows to backslashes. The File is used in FileEditor. Created attachment 35741 [details]
Store filename as string not as a file
The FileEditor component is used to edit/select filenames. It currently stores the filename as a File. That is problematic as java will convert slashes (/) to backslashes (\) when running on Windows.
This patch will store the filenames as simple String instances. That way no conversion will be done by java, except when filenames get selected through a file chooser dialog. In that case the patch will convert the backslashes to slashes when run on Windows.
If this patch works, would it be sensible to remove the inner class SimpleFileEditor from FileEditor? It seems to have no function anymore (when the patch is applied). Will be included in v4.1 @Benny, could you test the fix? Date: Sat Feb 24 17:01:14 2018 New Revision: 1825265 URL: http://svn.apache.org/viewvc?rev=1825265&view=rev Log: Store filename as String instead of File in FileEditor. This will prevent conversion of filenames from unix style path separators to Windows style when used for example in CSV Data Set Config. Bugzilla Id: 62127 Modified: jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/FileEditor.java jmeter/trunk/xdocs/changes.xml Tested the fix: OK I replaced ApacheJMeter_core.jar in the 4.0 release by the one from the nightly build of today. @Philippe or Felix, do you expect any problems doing this? (In reply to Benny van Wijngaarden from comment #10) > Tested the fix: OK > > I replaced ApacheJMeter_core.jar in the 4.0 release by the one from the > nightly build of today. @Philippe or Felix, do you expect any problems doing > this? What exactly do you mean by "this"? Do we expect problems when replacing the core jar or by the patch itself? In case of the patch itself, I don't expect problems. In case of replacing the jar, I think you might be safer replacing all jars (though if it works for you, it is probably OK for the nightly you chose). As you confirmed that the problem is fixed, I will close this bug. Thanks for the report and the confirmation. Do you have any idea when version 4.1 will be released? I have to decide whether to rollout the snapshot version in my team or wait for the 4.1 release. *** Bug 62715 has been marked as a duplicate of this bug. *** This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/4704 |