Lines 18-27
Link Here
|
18 |
|
18 |
|
19 |
package org.apache.jmeter.protocol.http.control.gui; |
19 |
package org.apache.jmeter.protocol.http.control.gui; |
20 |
|
20 |
|
21 |
import org.apache.jmeter.protocol.http.sampler.HTTPSamplerFactory; |
21 |
import java.awt.BorderLayout; |
|
|
22 |
import java.awt.Dimension; |
23 |
|
24 |
import javax.swing.Box; |
25 |
import javax.swing.JPanel; |
26 |
|
27 |
import org.apache.jmeter.protocol.http.sampler.HTTPSampler2; |
22 |
import org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase; |
28 |
import org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase; |
|
|
29 |
import org.apache.jmeter.protocol.http.sampler.HTTPSamplerFactory; |
23 |
import org.apache.jmeter.testelement.TestElement; |
30 |
import org.apache.jmeter.testelement.TestElement; |
24 |
import org.apache.jmeter.util.JMeterUtils; |
31 |
import org.apache.jmeter.util.JMeterUtils; |
|
|
32 |
import org.apache.jorphan.gui.JLabeledTextField; |
25 |
|
33 |
|
26 |
/** |
34 |
/** |
27 |
* HTTP Sampler GUI for Apache HTTPClient HTTP implementation |
35 |
* HTTP Sampler GUI for Apache HTTPClient HTTP implementation |
Lines 27-32
Link Here
|
27 |
* HTTP Sampler GUI for Apache HTTPClient HTTP implementation |
35 |
* HTTP Sampler GUI for Apache HTTPClient HTTP implementation |
28 |
*/ |
36 |
*/ |
29 |
public class HttpTestSampleGui2 extends HttpTestSampleGui { |
37 |
public class HttpTestSampleGui2 extends HttpTestSampleGui { |
|
|
38 |
|
39 |
private static final long serialVersionUID = 240L; |
40 |
|
41 |
private JLabeledTextField sourceIpAddr; |
30 |
|
42 |
|
31 |
public HttpTestSampleGui2() { |
43 |
public HttpTestSampleGui2() { |
32 |
super(); |
44 |
super(); |
Lines 51-54
Link Here
|
51 |
return super.getStaticLabel().replace(' ', '_'); // $NON-NLS-1$ // $NON-NLS-2$ |
63 |
return super.getStaticLabel().replace(' ', '_'); // $NON-NLS-1$ // $NON-NLS-2$ |
52 |
} |
64 |
} |
53 |
|
65 |
|
|
|
66 |
@Override |
67 |
protected JPanel createOptionalTasksPanel() { |
68 |
JPanel optionalTasksPanel = super.createOptionalTasksPanel(); |
69 |
// Add a new field source ip address |
70 |
sourceIpAddr = new JLabeledTextField(JMeterUtils |
71 |
.getResString("web_testing2_source_ip"), 15); // $NON-NLS-1$ |
72 |
optionalTasksPanel.add(sourceIpAddr, BorderLayout.EAST); |
73 |
|
74 |
return optionalTasksPanel; |
75 |
} |
76 |
|
77 |
/* (non-Javadoc) |
78 |
* @see org.apache.jmeter.protocol.http.control.gui.HttpTestSampleGui#clearGui() |
79 |
*/ |
80 |
@Override |
81 |
public void clearGui() { |
82 |
super.clearGui(); |
83 |
sourceIpAddr.setText(""); // $NON-NLS-1$ |
84 |
} |
85 |
|
86 |
/* (non-Javadoc) |
87 |
* @see org.apache.jmeter.protocol.http.control.gui.HttpTestSampleGui#configure(org.apache.jmeter.testelement.TestElement) |
88 |
*/ |
89 |
@Override |
90 |
public void configure(TestElement element) { |
91 |
super.configure(element); |
92 |
final HTTPSampler2 samplerBase = (HTTPSampler2) element; |
93 |
sourceIpAddr.setText(samplerBase.getIpSource()); |
94 |
} |
95 |
|
96 |
/* (non-Javadoc) |
97 |
* @see org.apache.jmeter.protocol.http.control.gui.HttpTestSampleGui#modifyTestElement(org.apache.jmeter.testelement.TestElement) |
98 |
*/ |
99 |
@Override |
100 |
public void modifyTestElement(TestElement sampler) { |
101 |
// TODO Auto-generated method stub |
102 |
super.modifyTestElement(sampler); |
103 |
final HTTPSampler2 samplerBase = (HTTPSampler2) sampler; |
104 |
samplerBase.setIpSource(sourceIpAddr.getText()); |
105 |
} |
54 |
} |
106 |
} |