Bug 57569 - FileServer.reserveFile - inconsistent behaviour when hasHeader is true
Summary: FileServer.reserveFile - inconsistent behaviour when hasHeader is true
Status: RESOLVED FIXED
Alias: None
Product: JMeter
Classification: Unclassified
Component: Main (show other bugs)
Version: 2.12
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-11 18:52 UTC by Sebb
Modified: 2015-02-11 20:09 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sebb 2015-02-11 18:52:14 UTC

    
Comment 1 Sebb 2015-02-11 19:53:41 UTC
FileServer.reserveFile has inconsistent behaviour when hasHeader is true.

The first time the method is called for a given file and alias, it will throw IllegalArgumentException if the file cannot be opened.
However subsequent invocations will return null.

If the file exists but is empty, the method will always return null.

The method ought to be consistent in its behaviour. It should either always return null, or always throw IllegalArgumentException.

The advantage of throwing IllegalArgumentException is that the exception can be used to provide additional information on why the header is not available.
Comment 2 Sebb 2015-02-11 20:09:11 UTC
URL: http://svn.apache.org/r1659056
Log:
FileServer.reserveFile - inconsistent behaviour when hasHeader is true
Bugzilla Id: 57569

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/services/FileServer.java
    jmeter/trunk/test/src/org/apache/jmeter/services/TestFileServer.java
    jmeter/trunk/xdocs/changes.xml

URL: http://svn.apache.org/r1659057
Log:
FileServer.reserveFile - inconsistent behaviour when hasHeader is true
Bugzilla Id: 57569

Added:
    jmeter/trunk/bin/testfiles/empty.csv