Author: sebb
Date: Sun Sep 21 16:07:43 2008
New Revision: 697636

URL: http://svn.apache.org/viewvc?rev=697636&view=rev
Log:
HTTPSamplers can now use variables in POSTed file names

Modified:
    
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
    jakarta/jmeter/trunk/xdocs/changes.xml

Modified: 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java?rev=697636&r1=697635&r2=697636&view=diff
==============================================================================
--- 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
 (original)
+++ 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
 Sun Sep 21 16:07:43 2008
@@ -271,10 +271,6 @@
      */
     public String getFileField() {
         checkCount("getFileField");
-        return getFileFieldProperty();
-    }
-
-    private String getFileFieldProperty() {
         return getPropertyAsString(FILE_FIELD);
     }
 
@@ -300,10 +296,6 @@
      */
     public String getFilename() {
         checkCount("getFilename");
-        return getFilenameProperty();
-    }
-
-    private String getFilenameProperty() {
         return getPropertyAsString(FILE_NAME);
     }
 
@@ -329,10 +321,6 @@
      */
     public String getMimetype() {
         checkCount("getMimetype");
-        return getMimetypeProperty();
-    }
-
-    private String getMimetypeProperty() {
         return getPropertyAsString(MIMETYPE);
     }
 
@@ -1460,9 +1448,10 @@
         }
         HTTPFileArg[] outFiles;
         // Check for original data names
-        String fileName = getFilenameProperty();
-        String paramName = getFileFieldProperty();
-        String mimeType = getMimetypeProperty();
+        // Use properties so variables and functions are not resolved too early
+        JMeterProperty fileName = getProperty(FILE_NAME);
+        JMeterProperty paramName = getProperty(FILE_FIELD);
+        JMeterProperty mimeType = getProperty(MIMETYPE);
         HTTPFileArg file = new HTTPFileArg(fileName, paramName, mimeType);
         if(file.isNotEmpty()) {
             // Now deal with any additional file arguments

Modified: jakarta/jmeter/trunk/xdocs/changes.xml
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/xdocs/changes.xml?rev=697636&r1=697635&r2=697636&view=diff
==============================================================================
--- jakarta/jmeter/trunk/xdocs/changes.xml (original)
+++ jakarta/jmeter/trunk/xdocs/changes.xml Sun Sep 21 16:07:43 2008
@@ -106,6 +106,7 @@
 "Save Results to a file" and "Generate Summary Results" are now shown as 
Listeners.
 "Counter" is now shown as a Configuration element.
 </li>
+<li>HTTPSamplers can now use variables in POSTed file names</li>
 </ul>
 
 <h3>Improvements</h3>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to