Bug 55099

Summary: ResultSaver should create intermediate directories
Product: JMeter Reporter: Peter <peter.eichenauer>
Component: MainAssignee: JMeter issues mailing list <issues>
Status: NEW ---    
Severity: enhancement CC: jan_janousek, p.mouawad
Priority: P4    
Version: 2.9   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: Patch for ResultSaver

Description Peter 2013-06-13 14:08:41 UTC
A FileNotFoundException is thrown if you use a relative path as 'Filename prefix' and a directory doesn't exist.

jmeter.reporters.ResultSaver: Error creating sample file for PicURL java.io.FileNotFoundException: 
	at java.io.FileOutputStream.open(Native Method)
	at java.io.FileOutputStream.<init>(Unknown Source)
	at java.io.FileOutputStream.<init>(Unknown Source)
	at org.apache.jmeter.reporters.ResultSaver.saveSample(ResultSaver.java:188)
	at org.apache.jmeter.reporters.ResultSaver.processSample(ResultSaver.java:150)
	at org.apache.jmeter.reporters.ResultSaver.sampleOccurred(ResultSaver.java:140)
	at org.apache.jmeter.threads.ListenerNotifier.notifyListeners(ListenerNotifier.java:84)
	at org.apache.jmeter.threads.JMeterThread.notifyListeners(JMeterThread.java:783)
	at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:442)
	at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256)
Comment 1 Sebb 2013-06-13 15:33:44 UTC
That's a valid response - the file cannot be found.

What do you expect to happen?
Comment 2 Peter 2013-06-13 19:02:55 UTC
The file is generated at run time. I read the description from JMeter documentation: "Prefix for the generated file names; this can include a directory name."

In my case it would be convenient to generate directories as well because the directory structure depends on the test plan.

To generate directories should be a small modification of ResultSaver.
Comment 3 Peter 2013-08-16 13:24:31 UTC
Created attachment 30737 [details]
Patch for ResultSaver

patch includes a TestCase