View | Details | Raw Unified | Return to bug 33964
Collapse All | Expand All

(-)head.ori/jakarta-jmeter/src/core/org/apache/jmeter/resources/messages.properties (+1 lines)
Lines 496-501 Link Here
496
send_file_filename_label=Filename\:
496
send_file_filename_label=Filename\:
497
send_file_mime_label=MIME Type\:
497
send_file_mime_label=MIME Type\:
498
send_file_param_name_label=Parameter Name\:
498
send_file_param_name_label=Parameter Name\:
499
send_post_data=Send as post body
499
server=Server Name or IP\:
500
server=Server Name or IP\:
500
servername=Servername \:
501
servername=Servername \:
501
session_argument_name=Session Argument Name
502
session_argument_name=Session Argument Name
(-)head.ori/jakarta-jmeter/src/core/org/apache/jmeter/util/JMeterVersion.java (-1 / +1 lines)
Lines 42-48 Link Here
42
	 * This ensures that JMeterUtils always gets the correct version, even if it is
42
	 * This ensures that JMeterUtils always gets the correct version, even if it is
43
	 * not re-compiled during the build.
43
	 * not re-compiled during the build.
44
	 */
44
	 */
45
	private static final String VERSION = "2.1.20050318";
45
	private static final String VERSION = "2.1.20050413";
46
46
47
	static final String COPYRIGHT = "Copyright (c) 1998-2005 The Apache Software Foundation";
47
	static final String COPYRIGHT = "Copyright (c) 1998-2005 The Apache Software Foundation";
48
	
48
	
(-)head.ori/jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/config/gui/MultipartUrlConfigGui.java (-7 / +13 lines)
Lines 24-41 Link Here
24
import java.awt.event.ActionListener;
24
import java.awt.event.ActionListener;
25
import java.io.File;
25
import java.io.File;
26
26
27
import javax.swing.BorderFactory;
27
import javax.swing.*;
28
import javax.swing.BoxLayout;
29
import javax.swing.JButton;
30
import javax.swing.JFileChooser;
31
import javax.swing.JLabel;
32
import javax.swing.JPanel;
33
import javax.swing.JTextField;
34
28
35
import org.apache.jmeter.gui.util.FileDialoger;
29
import org.apache.jmeter.gui.util.FileDialoger;
36
import org.apache.jmeter.gui.util.VerticalPanel;
30
import org.apache.jmeter.gui.util.VerticalPanel;
37
import org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase;
31
import org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase;
38
import org.apache.jmeter.testelement.TestElement;
32
import org.apache.jmeter.testelement.TestElement;
33
import org.apache.jmeter.testelement.AbstractTestElement;
34
import org.apache.jmeter.testelement.property.BooleanProperty;
39
import org.apache.jmeter.util.JMeterUtils;
35
import org.apache.jmeter.util.JMeterUtils;
40
36
41
37
Lines 51-61 Link Here
51
    private JTextField filenameField;
47
    private JTextField filenameField;
52
    private JTextField paramNameField;
48
    private JTextField paramNameField;
53
    private JTextField mimetypeField;
49
    private JTextField mimetypeField;
50
    private JCheckBox postData;
54
51
55
    private static String FILENAME = "filename";
52
    private static String FILENAME = "filename";
56
    private static String BROWSE = "browse";
53
    private static String BROWSE = "browse";
57
    private static String PARAMNAME = "paramname";
54
    private static String PARAMNAME = "paramname";
58
    private static String MIMETYPE = "mimetype";
55
    private static String MIMETYPE = "mimetype";
56
    private static String POSTDATA ="postdata";
59
57
60
    public MultipartUrlConfigGui()
58
    public MultipartUrlConfigGui()
61
    {
59
    {
Lines 70-75 Link Here
70
        ce.setProperty(HTTPSamplerBase.MIMETYPE, mimetypeField.getText());
68
        ce.setProperty(HTTPSamplerBase.MIMETYPE, mimetypeField.getText());
71
        ce.setProperty(HTTPSamplerBase.FILE_NAME, filenameField.getText());
69
        ce.setProperty(HTTPSamplerBase.FILE_NAME, filenameField.getText());
72
        ce.setProperty(HTTPSamplerBase.FILE_FIELD, paramNameField.getText());
70
        ce.setProperty(HTTPSamplerBase.FILE_FIELD, paramNameField.getText());
71
        ce.setProperty(new BooleanProperty(HTTPSamplerBase.POSTDATA,
72
            postData.isSelected()));
73
        return ce;
73
        return ce;
74
    }
74
    }
75
75
Lines 88-93 Link Here
88
        mimetypeField.setText(el.getPropertyAsString(HTTPSamplerBase.MIMETYPE));
88
        mimetypeField.setText(el.getPropertyAsString(HTTPSamplerBase.MIMETYPE));
89
        filenameField.setText(el.getPropertyAsString(HTTPSamplerBase.FILE_NAME));
89
        filenameField.setText(el.getPropertyAsString(HTTPSamplerBase.FILE_NAME));
90
        paramNameField.setText(el.getPropertyAsString(HTTPSamplerBase.FILE_FIELD));
90
        paramNameField.setText(el.getPropertyAsString(HTTPSamplerBase.FILE_FIELD));
91
        postData.setSelected(((AbstractTestElement) el).getPropertyAsBoolean(HTTPSamplerBase.POSTDATA));
91
    }
92
    }
92
93
93
    public String getLabelResource()
94
    public String getLabelResource()
Lines 158-163 Link Here
158
                BorderFactory.createEtchedBorder(),
159
                BorderFactory.createEtchedBorder(),
159
                JMeterUtils.getResString("send_file")));
160
                JMeterUtils.getResString("send_file")));
160
161
162
        postData = new JCheckBox(JMeterUtils.getResString("send_post_data"));
163
        postData.setName(POSTDATA);
164
        postData.setSelected(false);// will be reset by configure(TestElement)
165
        filePanel.add(postData);
161
        filePanel.add(createFilenamePanel());
166
        filePanel.add(createFilenamePanel());
162
        filePanel.add(createFileParamNamePanel());
167
        filePanel.add(createFileParamNamePanel());
163
        filePanel.add(createFileMimeTypePanel());
168
        filePanel.add(createFileMimeTypePanel());
Lines 226-230 Link Here
226
        filenameField.setText("");
231
        filenameField.setText("");
227
        mimetypeField.setText("");
232
        mimetypeField.setText("");
228
        paramNameField.setText("");
233
        paramNameField.setText("");
234
        postData.setSelected(false);
229
    }
235
    }
230
}
236
}
(-)head.ori/jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java (+11 lines)
Lines 71-76 Link Here
71
    public final static String DOMAIN= "HTTPSampler.domain";
71
    public final static String DOMAIN= "HTTPSampler.domain";
72
    public final static String PORT= "HTTPSampler.port";
72
    public final static String PORT= "HTTPSampler.port";
73
    public final static String METHOD= "HTTPSampler.method";
73
    public final static String METHOD= "HTTPSampler.method";
74
    public final static String POSTDATA = "HTTPSampler.postdata";
74
75
75
    public final static String PATH= "HTTPSampler.path";
76
    public final static String PATH= "HTTPSampler.path";
76
    public final static String FOLLOW_REDIRECTS= "HTTPSampler.follow_redirects";
77
    public final static String FOLLOW_REDIRECTS= "HTTPSampler.follow_redirects";
Lines 193-198 Link Here
193
        return p;
194
        return p;
194
    }
195
    }
195
196
197
    public void setSendPostData(boolean value)
198
    {
199
        setProperty(new BooleanProperty(POSTDATA, value));
200
    }
201
202
    public boolean getSendPostData()
203
    {
204
        return getPropertyAsBoolean(POSTDATA);
205
    }
206
196
    public void setFollowRedirects(boolean value)
207
    public void setFollowRedirects(boolean value)
197
    {
208
    {
198
        setProperty(new BooleanProperty(FOLLOW_REDIRECTS, value));
209
        setProperty(new BooleanProperty(FOLLOW_REDIRECTS, value));
(-)head.ori/jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/sampler/PostWriter.java (+13 lines)
Lines 52-57 Link Here
52
        if ((filename != null) && (filename.trim().length() > 0))
52
        if ((filename != null) && (filename.trim().length() > 0))
53
        {
53
        {
54
            OutputStream out = connection.getOutputStream();
54
            OutputStream out = connection.getOutputStream();
55
            if (sampler.getSendPostData())
56
            {
57
                InputStream in = getFileStream(filename);
58
                byte[] buf = new byte[1024];
59
                int read;
60
                while ((read = in.read(buf)) > 0)
61
                {
62
                    out.write(buf, 0, read);
63
                }
64
                out.flush();
65
                in.close();
66
                return;
67
            }
55
            //new FileOutputStream("c:\\data\\experiment.txt");
68
            //new FileOutputStream("c:\\data\\experiment.txt");
56
            //new ByteArrayOutputStream();
69
            //new ByteArrayOutputStream();
57
            writeln(out, "--" + BOUNDARY);
70
            writeln(out, "--" + BOUNDARY);

Return to bug 33964