Author: sebb
Date: Wed Jun 17 00:09:08 2009
New Revision: 785454

URL: http://svn.apache.org/viewvc?rev=785454&view=rev
Log:
Bug 47266 - FTP Request Sampler: allow specifying an FTP port, other than the 
default

Modified:
    jakarta/jmeter/trunk/docs/changes.html
    jakarta/jmeter/trunk/docs/images/screenshots/ftptest/ftp-request.png
    jakarta/jmeter/trunk/docs/usermanual/component_reference.html
    
jakarta/jmeter/trunk/src/protocol/ftp/org/apache/jmeter/protocol/ftp/config/gui/FtpConfigGui.java
    
jakarta/jmeter/trunk/src/protocol/ftp/org/apache/jmeter/protocol/ftp/sampler/FTPSampler.java
    jakarta/jmeter/trunk/xdocs/changes.xml
    jakarta/jmeter/trunk/xdocs/images/screenshots/ftptest/ftp-request.png
    jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml

Modified: jakarta/jmeter/trunk/docs/changes.html
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/docs/changes.html?rev=785454&r1=785453&r2=785454&view=diff
==============================================================================
--- jakarta/jmeter/trunk/docs/changes.html (original)
+++ jakarta/jmeter/trunk/docs/changes.html Wed Jun 17 00:09:08 2009
@@ -168,6 +168,7 @@
 </h2>
 <p>
 
+This is a minor bug-fix release, mainly to correct some bugs that were 
accidentally added in 2.3.3.
 
 </p>
 <h2>
@@ -291,6 +292,16 @@
 </li>
 
 
+<li>
+Bug 47377 - Make ClassFinder more robust and close zipfile resources
+</li>
+
+
+<li>
+Fix some errors in generating the documentation (latent bug revealed in 2.3.3 
when Velocity was upgraded)
+</li>
+
+
 </ul>
 <h2>
 Improvements
@@ -308,6 +319,11 @@
 <ul>
 
 
+<li>
+Bug 47266 - FTP Request Sampler: allow specifying an FTP port, other than the 
default
+</li>
+
+
 </ul>
 <h3>
 Controllers

Modified: jakarta/jmeter/trunk/docs/images/screenshots/ftptest/ftp-request.png
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/docs/images/screenshots/ftptest/ftp-request.png?rev=785454&r1=785453&r2=785454&view=diff
==============================================================================
Binary files - no diff available.

Modified: jakarta/jmeter/trunk/docs/usermanual/component_reference.html
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/docs/usermanual/component_reference.html?rev=785454&r1=785453&r2=785454&view=diff
==============================================================================
--- jakarta/jmeter/trunk/docs/usermanual/component_reference.html (original)
+++ jakarta/jmeter/trunk/docs/usermanual/component_reference.html Wed Jun 17 
00:09:08 2009
@@ -318,7 +318,7 @@
 
 
 <p><b>Control Panel</b></p>
-<div align="center"><img width='502' height='299' 
src="../images/screenshots/ftptest/ftp-request.png"></div>
+<div align="center"><img width='499' height='292' 
src="../images/screenshots/ftptest/ftp-request.png"></div>
 <p>
 <b>Parameters</b>
 <table border="1" cellspacing="0" cellpadding="2">
@@ -334,13 +334,20 @@
 <tr>
 <td>Server Name or IP</td>
 <td>Domain name or IP address of the FTP server.
-JMeter assumes the FTP server is listening on the default port.
 </td>
 <td>
 Yes
 </td>
 </tr>
 <tr>
+<td>Port</td>
+<td>Port to use. If this is  >0, then this specific port is used, otherwise 
JMeter uses the default FTP port.
+</td>
+<td>
+No
+</td>
+</tr>
+<tr>
 <td>Remote File:</td>
 <td>File to retrieve or name of destination file to upload.
 </td>

Modified: 
jakarta/jmeter/trunk/src/protocol/ftp/org/apache/jmeter/protocol/ftp/config/gui/FtpConfigGui.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/ftp/org/apache/jmeter/protocol/ftp/config/gui/FtpConfigGui.java?rev=785454&r1=785453&r2=785454&view=diff
==============================================================================
--- 
jakarta/jmeter/trunk/src/protocol/ftp/org/apache/jmeter/protocol/ftp/config/gui/FtpConfigGui.java
 (original)
+++ 
jakarta/jmeter/trunk/src/protocol/ftp/org/apache/jmeter/protocol/ftp/config/gui/FtpConfigGui.java
 Wed Jun 17 00:09:08 2009
@@ -20,6 +20,7 @@
 
 import java.awt.BorderLayout;
 
+import javax.swing.BorderFactory;
 import javax.swing.ButtonGroup;
 import javax.swing.JCheckBox;
 import javax.swing.JLabel;
@@ -40,6 +41,8 @@
 
     private JTextField server;
 
+    private JTextField port;
+
     private JTextField remoteFile;
 
     private JTextField localFile;
@@ -73,6 +76,7 @@
         super.configure(element); // TODO - should this be done for embedded 
usage?
         // Note: the element is a ConfigTestElement when used standalone, so 
we cannot use FTPSampler access methods
         server.setText(element.getPropertyAsString(FTPSampler.SERVER));
+        port.setText(element.getPropertyAsString(FTPSampler.PORT));
         
remoteFile.setText(element.getPropertyAsString(FTPSampler.REMOTE_FILENAME));
         
localFile.setText(element.getPropertyAsString(FTPSampler.LOCAL_FILENAME));
         inputData.setText(element.getPropertyAsString(FTPSampler.INPUT_DATA));
@@ -101,6 +105,7 @@
         configureTestElement(element);
         // Note: the element is a ConfigTestElement, so cannot use FTPSampler 
access methods
         element.setProperty(FTPSampler.SERVER,server.getText());
+        element.setProperty(FTPSampler.PORT,port.getText());
         element.setProperty(FTPSampler.REMOTE_FILENAME,remoteFile.getText());
         element.setProperty(FTPSampler.LOCAL_FILENAME,localFile.getText());
         element.setProperty(FTPSampler.INPUT_DATA,inputData.getText());
@@ -116,6 +121,7 @@
         super.clearGui();
 
         server.setText(""); //$NON-NLS-1$
+        port.setText(""); //$NON-NLS-1$
         remoteFile.setText(""); //$NON-NLS-1$
         localFile.setText(""); //$NON-NLS-1$
         inputData.setText(""); //$NON-NLS-1$
@@ -137,6 +143,19 @@
         return serverPanel;
     }
 
+    private JPanel getPortPanel() {
+        port = new JTextField(4);
+
+        JLabel label = new 
JLabel(JMeterUtils.getResString("web_server_port")); // $NON-NLS-1$
+        label.setLabelFor(port);
+
+        JPanel panel = new JPanel(new BorderLayout(5, 0));
+        panel.add(label, BorderLayout.WEST);
+        panel.add(port, BorderLayout.CENTER);
+
+        return panel;
+    }
+
     private JPanel createLocalFilenamePanel() {
         JLabel label = new JLabel(JMeterUtils.getResString("ftp_local_file")); 
//$NON-NLS-1$
 
@@ -205,7 +224,10 @@
 
         // MAIN PANEL
         VerticalPanel mainPanel = new VerticalPanel();
-        mainPanel.add(createServerPanel());
+        JPanel serverPanel = new HorizontalPanel();
+        serverPanel.add(createServerPanel(), BorderLayout.CENTER);
+        serverPanel.add(getPortPanel(), BorderLayout.EAST);
+        mainPanel.add(serverPanel);
         mainPanel.add(createRemoteFilenamePanel());
         mainPanel.add(createLocalFilenamePanel());
         mainPanel.add(createLocalFileContentsPanel());

Modified: 
jakarta/jmeter/trunk/src/protocol/ftp/org/apache/jmeter/protocol/ftp/sampler/FTPSampler.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/ftp/org/apache/jmeter/protocol/ftp/sampler/FTPSampler.java?rev=785454&r1=785453&r2=785454&view=diff
==============================================================================
--- 
jakarta/jmeter/trunk/src/protocol/ftp/org/apache/jmeter/protocol/ftp/sampler/FTPSampler.java
 (original)
+++ 
jakarta/jmeter/trunk/src/protocol/ftp/org/apache/jmeter/protocol/ftp/sampler/FTPSampler.java
 Wed Jun 17 00:09:08 2009
@@ -53,6 +53,8 @@
 
     public final static String SERVER = "FTPSampler.server"; // $NON-NLS-1$
 
+    public final static String PORT = "FTPSampler.port"; // $NON-NLS-1$
+
     // N.B. Originally there was only one filename, and only get(RETR) was 
supported
     // To maintain backwards compatibility, the property name needs to remain 
the same
     public final static String REMOTE_FILENAME = "FTPSampler.filename"; // 
$NON-NLS-1$
@@ -91,6 +93,18 @@
         return getPropertyAsString(SERVER);
     }
 
+    public void setPort(String newPort) {
+        this.setProperty(PORT, newPort, ""); // $NON-NLS-1$
+    }
+
+    public String getPort() {
+        return getPropertyAsString(PORT, ""); // $NON-NLS-1$
+    }
+
+    public int getPortAsInt() {
+        return getPropertyAsInt(PORT, 0);
+    }
+
     public String getRemoteFilename() {
         return getPropertyAsString(REMOTE_FILENAME);
     }
@@ -127,6 +141,11 @@
         sb.setNullText("null");// $NON-NLS-1$
         sb.append("ftp://";);// $NON-NLS-1$
         sb.append(getServer());
+        String port = getPort();
+        if (port.length() > 0){
+            sb.append(':');
+            sb.append(port);
+        }
         sb.append("/");// $NON-NLS-1$
         sb.append(getRemoteFilename());
         sb.append(isBinaryMode() ? " (Binary) " : " (Ascii) ");// $NON-NLS-1$ 
$NON-NLS-2$
@@ -156,7 +175,12 @@
         FTPClient ftp = new FTPClient();
         try {
             savedClient = ftp;
-            ftp.connect(getServer());
+            final int port = getPortAsInt();
+            if (port > 0){
+                ftp.connect(getServer(),port);                
+            } else {
+                ftp.connect(getServer());
+            }
             res.latencyEnd();
             int reply = ftp.getReplyCode();
             if (FTPReply.isPositiveCompletion(reply))

Modified: jakarta/jmeter/trunk/xdocs/changes.xml
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/xdocs/changes.xml?rev=785454&r1=785453&r2=785454&view=diff
==============================================================================
--- jakarta/jmeter/trunk/xdocs/changes.xml (original)
+++ jakarta/jmeter/trunk/xdocs/changes.xml Wed Jun 17 00:09:08 2009
@@ -36,6 +36,7 @@
 <h2>Summary of main changes</h2>
 
 <p>
+This is a minor bug-fix release, mainly to correct some bugs that were 
accidentally added in 2.3.3.
 </p>
 
 
@@ -103,6 +104,7 @@
 <ul>
 <li>Fix problems with remote clients - bug introduced in 2.3.3</li>
 <li>Bug 47377 - Make ClassFinder more robust and close zipfile resources</li>
+<li>Fix some errors in generating the documentation (latent bug revealed in 
2.3.3 when Velocity was upgraded)</li>
 </ul>
 
 <!-- ==================================================== -->
@@ -115,6 +117,7 @@
 
 <h3>Other samplers</h3>
 <ul>
+<li>Bug 47266 - FTP Request Sampler: allow specifying an FTP port, other than 
the default</li>
 </ul>
 
 <h3>Controllers</h3>

Modified: jakarta/jmeter/trunk/xdocs/images/screenshots/ftptest/ftp-request.png
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/xdocs/images/screenshots/ftptest/ftp-request.png?rev=785454&r1=785453&r2=785454&view=diff
==============================================================================
Binary files - no diff available.

Modified: jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml?rev=785454&r1=785453&r2=785454&view=diff
==============================================================================
--- jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml (original)
+++ jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml Wed Jun 17 
00:09:08 2009
@@ -46,7 +46,7 @@
        The sample results have various attributes (success/fail, elapsed time, 
data size etc) and can be viewed in the various listeners.
        </p>
 </description>
-<component name="FTP Request" index="&sect-num;.1.1" width="502" height="299" 
screenshot="ftptest/ftp-request.png">
+<component name="FTP Request" index="&sect-num;.1.1" width="499" height="292" 
screenshot="ftptest/ftp-request.png">
 <description>
 This controller lets you send an FTP "retrieve file" or "upload file" request 
to an FTP server.
 If you are going to send multiple requests to the same FTP server, consider
@@ -59,8 +59,8 @@
 </description>
 <properties>
         <property name="Name" required="No">Descriptive name for this 
controller that is shown in the tree.</property>
-        <property name="Server Name or IP" required="Yes">Domain name or IP 
address of the FTP server.
-JMeter assumes the FTP server is listening on the default port.</property>
+        <property name="Server Name or IP" required="Yes">Domain name or IP 
address of the FTP server.</property>
+        <property name="Port" required="No">Port to use. If this is  >0, then 
this specific port is used, otherwise JMeter uses the default FTP 
port.</property>
         <property name="Remote File:" required="Yes">File to retrieve or name 
of destination file to upload.</property>
         <property name="Local File:" required="Yes, if uploading (*)">File to 
upload, or destination for downloads (defaults to remote file name).</property>
         <property name="Local File Contents:" required="Yes, if uploading 
(*)">Provides the contents for the upload, overrides the Local File 
property.</property>



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to