Lines 57-62
Link Here
|
57 |
import org.apache.jmeter.gui.util.HorizontalPanel; |
57 |
import org.apache.jmeter.gui.util.HorizontalPanel; |
58 |
import org.apache.jmeter.gui.util.MenuFactory; |
58 |
import org.apache.jmeter.gui.util.MenuFactory; |
59 |
import org.apache.jmeter.gui.util.PowerTableModel; |
59 |
import org.apache.jmeter.gui.util.PowerTableModel; |
|
|
60 |
import org.apache.jmeter.gui.util.VerticalPanel; |
60 |
import org.apache.jmeter.protocol.http.proxy.ProxyControl; |
61 |
import org.apache.jmeter.protocol.http.proxy.ProxyControl; |
61 |
import org.apache.jmeter.testelement.TestElement; |
62 |
import org.apache.jmeter.testelement.TestElement; |
62 |
import org.apache.jmeter.testelement.TestPlan; |
63 |
import org.apache.jmeter.testelement.TestPlan; |
Lines 112-123
Link Here
|
112 |
* Set/clear the Redirect automatically box on the samplers (default is false) |
113 |
* Set/clear the Redirect automatically box on the samplers (default is false) |
113 |
*/ |
114 |
*/ |
114 |
private JCheckBox samplerRedirectAutomatically; |
115 |
private JCheckBox samplerRedirectAutomatically; |
|
|
116 |
|
115 |
/** |
117 |
/** |
116 |
* Set/clear the Follow-redirects box on the samplers (default is true) |
118 |
* Set/clear the Follow-redirects box on the samplers (default is true) |
117 |
*/ |
119 |
*/ |
118 |
private JCheckBox samplerFollowRedirects; |
120 |
private JCheckBox samplerFollowRedirects; |
119 |
|
121 |
|
120 |
|
|
|
121 |
/** |
122 |
/** |
122 |
* Set/clear the Download images box on the samplers (default is false) |
123 |
* Set/clear the Download images box on the samplers (default is false) |
123 |
*/ |
124 |
*/ |
Lines 128-133
Link Here
|
128 |
* even if it is really https. |
129 |
* even if it is really https. |
129 |
*/ |
130 |
*/ |
130 |
private JCheckBox httpsSpoof; |
131 |
private JCheckBox httpsSpoof; |
|
|
132 |
|
133 |
/** |
134 |
* Regular expression to include results based on content type |
135 |
*/ |
136 |
private JTextField contentTypeInclude; |
137 |
|
138 |
/** |
139 |
* Regular expression to exclude results based on content type |
140 |
*/ |
141 |
private JTextField contentTypeExclude; |
131 |
|
142 |
|
132 |
/** |
143 |
/** |
133 |
* List of available target controllers |
144 |
* List of available target controllers |
Lines 207-213
Link Here
|
207 |
model.setUseKeepAlive(useKeepAlive.isSelected()); |
218 |
model.setUseKeepAlive(useKeepAlive.isSelected()); |
208 |
model.setSamplerDownloadImages(samplerDownloadImages.isSelected()); |
219 |
model.setSamplerDownloadImages(samplerDownloadImages.isSelected()); |
209 |
model.setRegexMatch(regexMatch.isSelected()); |
220 |
model.setRegexMatch(regexMatch.isSelected()); |
210 |
model.setHttpsSpoof(httpsSpoof.isSelected()); |
221 |
model.setHttpsSpoof(httpsSpoof.isSelected()); |
|
|
222 |
model.setContentTypeInclude(contentTypeInclude.getText()); |
223 |
model.setContentTypeExclude(contentTypeExclude.getText()); |
211 |
TreeNodeWrapper nw = (TreeNodeWrapper) targetNodes.getSelectedItem(); |
224 |
TreeNodeWrapper nw = (TreeNodeWrapper) targetNodes.getSelectedItem(); |
212 |
if (nw == null) { |
225 |
if (nw == null) { |
213 |
model.setTarget(null); |
226 |
model.setTarget(null); |
Lines 259-264
Link Here
|
259 |
samplerDownloadImages.setSelected(model.getSamplerDownloadImages()); |
272 |
samplerDownloadImages.setSelected(model.getSamplerDownloadImages()); |
260 |
regexMatch.setSelected(model.getRegexMatch()); |
273 |
regexMatch.setSelected(model.getRegexMatch()); |
261 |
httpsSpoof.setSelected(model.getHttpsSpoof()); |
274 |
httpsSpoof.setSelected(model.getHttpsSpoof()); |
|
|
275 |
contentTypeInclude.setText(model.getContentTypeInclude()); |
276 |
contentTypeExclude.setText(model.getContentTypeExclude()); |
262 |
|
277 |
|
263 |
reinitializeTargetCombo();// Set up list of potential targets and |
278 |
reinitializeTargetCombo();// Set up list of potential targets and |
264 |
// enable listener |
279 |
// enable listener |
Lines 324-330
Link Here
|
324 |
|| command.equals(ProxyControl.USE_KEEPALIVE) |
339 |
|| command.equals(ProxyControl.USE_KEEPALIVE) |
325 |
|| command.equals(ProxyControl.SAMPLER_DOWNLOAD_IMAGES) |
340 |
|| command.equals(ProxyControl.SAMPLER_DOWNLOAD_IMAGES) |
326 |
|| command.equals(ProxyControl.REGEX_MATCH) |
341 |
|| command.equals(ProxyControl.REGEX_MATCH) |
327 |
|| command.equals(ProxyControl.HTTPS_SPOOF)) { |
342 |
|| command.equals(ProxyControl.HTTPS_SPOOF) |
|
|
343 |
|| command.equals(ProxyControl.CONTENT_TYPE_INCLUDE) |
344 |
|| command.equals(ProxyControl.CONTENT_TYPE_EXCLUDE)) { |
328 |
enableRestart(); |
345 |
enableRestart(); |
329 |
} else if (command.equals(ADD_EXCLUDE)) { |
346 |
} else if (command.equals(ADD_EXCLUDE)) { |
330 |
excludeModel.addNewRow(); |
347 |
excludeModel.addNewRow(); |
Lines 437-446
Link Here
|
437 |
myBox.add(Box.createVerticalStrut(5)); |
454 |
myBox.add(Box.createVerticalStrut(5)); |
438 |
myBox.add(createHTTPSamplerPanel()); |
455 |
myBox.add(createHTTPSamplerPanel()); |
439 |
myBox.add(Box.createVerticalStrut(5)); |
456 |
myBox.add(Box.createVerticalStrut(5)); |
440 |
myBox.add(createTargetPanel()); |
457 |
myBox.add(createContentTypePanel()); |
441 |
myBox.add(Box.createVerticalStrut(5)); |
458 |
myBox.add(Box.createVerticalStrut(5)); |
442 |
myBox.add(createGroupingPanel()); |
|
|
443 |
myBox.add(Box.createVerticalStrut(5)); |
444 |
mainPanel.add(myBox, BorderLayout.NORTH); |
459 |
mainPanel.add(myBox, BorderLayout.NORTH); |
445 |
|
460 |
|
446 |
Box includeExcludePanel = Box.createVerticalBox(); |
461 |
Box includeExcludePanel = Box.createVerticalBox(); |
Lines 501-508
Link Here
|
501 |
} |
516 |
} |
502 |
|
517 |
|
503 |
private JPanel createTestPlanContentPanel() { |
518 |
private JPanel createTestPlanContentPanel() { |
504 |
JLabel label = new JLabel("Test plan content:"); |
|
|
505 |
|
506 |
httpHeaders = new JCheckBox(JMeterUtils.getResString("proxy_headers")); |
519 |
httpHeaders = new JCheckBox(JMeterUtils.getResString("proxy_headers")); |
507 |
httpHeaders.setName(ProxyControl.CAPTURE_HTTP_HEADERS); |
520 |
httpHeaders.setName(ProxyControl.CAPTURE_HTTP_HEADERS); |
508 |
httpHeaders.setSelected(true); // maintain original default |
521 |
httpHeaders.setSelected(true); // maintain original default |
Lines 521-539
Link Here
|
521 |
regexMatch.addActionListener(this); |
534 |
regexMatch.addActionListener(this); |
522 |
regexMatch.setActionCommand(ProxyControl.REGEX_MATCH); |
535 |
regexMatch.setActionCommand(ProxyControl.REGEX_MATCH); |
523 |
|
536 |
|
524 |
HorizontalPanel panel = new HorizontalPanel(); |
537 |
VerticalPanel mainPanel = new VerticalPanel(); |
525 |
panel.add(label); |
538 |
mainPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), |
|
|
539 |
JMeterUtils.getResString("proxy_test_plan_content"))); |
526 |
|
540 |
|
527 |
panel.add(httpHeaders); |
541 |
HorizontalPanel nodeCreationPanel = new HorizontalPanel(); |
528 |
panel.add(addAssertions); |
542 |
nodeCreationPanel.add(httpHeaders); |
529 |
panel.add(regexMatch); |
543 |
nodeCreationPanel.add(addAssertions); |
|
|
544 |
nodeCreationPanel.add(regexMatch); |
545 |
|
546 |
mainPanel.add(createTargetPanel()); |
547 |
mainPanel.add(createGroupingPanel()); |
548 |
mainPanel.add(nodeCreationPanel); |
530 |
|
549 |
|
531 |
return panel; |
550 |
return mainPanel; |
532 |
} |
551 |
} |
533 |
|
552 |
|
534 |
private JPanel createHTTPSamplerPanel() { |
553 |
private JPanel createHTTPSamplerPanel() { |
535 |
JLabel label = new JLabel("HTTP Sampler settings:"); |
|
|
536 |
|
537 |
DefaultComboBoxModel m = new DefaultComboBoxModel(); |
554 |
DefaultComboBoxModel m = new DefaultComboBoxModel(); |
538 |
// Note: position of these elements in the menu *must* match the |
555 |
// Note: position of these elements in the menu *must* match the |
539 |
// corresponding ProxyControl.SAMPLER_TYPE_* values. |
556 |
// corresponding ProxyControl.SAMPLER_TYPE_* values. |
Lines 543-577
Link Here
|
543 |
samplerTypeName.setName(ProxyControl.SAMPLER_TYPE_NAME); |
560 |
samplerTypeName.setName(ProxyControl.SAMPLER_TYPE_NAME); |
544 |
samplerTypeName.setSelectedIndex(0); |
561 |
samplerTypeName.setSelectedIndex(0); |
545 |
samplerTypeName.addItemListener(this); |
562 |
samplerTypeName.addItemListener(this); |
546 |
JLabel label2 = new JLabel("Type:"); |
563 |
JLabel label2 = new JLabel(JMeterUtils.getResString("proxy_sampler_type")); |
547 |
label2.setLabelFor(samplerTypeName); |
564 |
label2.setLabelFor(samplerTypeName); |
548 |
|
565 |
|
549 |
samplerRedirectAutomatically = new JCheckBox("Redirect automatically"); |
566 |
samplerRedirectAutomatically = new JCheckBox(JMeterUtils.getResString("follow_redirects_auto")); |
550 |
samplerRedirectAutomatically.setName(ProxyControl.SAMPLER_REDIRECT_AUTOMATICALLY); |
567 |
samplerRedirectAutomatically.setName(ProxyControl.SAMPLER_REDIRECT_AUTOMATICALLY); |
551 |
samplerRedirectAutomatically.setSelected(false); |
568 |
samplerRedirectAutomatically.setSelected(false); |
552 |
samplerRedirectAutomatically.addActionListener(this); |
569 |
samplerRedirectAutomatically.addActionListener(this); |
553 |
samplerRedirectAutomatically.setActionCommand(ProxyControl.SAMPLER_REDIRECT_AUTOMATICALLY); |
570 |
samplerRedirectAutomatically.setActionCommand(ProxyControl.SAMPLER_REDIRECT_AUTOMATICALLY); |
554 |
|
571 |
|
555 |
samplerFollowRedirects = new JCheckBox("Follow redirects"); |
572 |
samplerFollowRedirects = new JCheckBox(JMeterUtils.getResString("follow_redirects")); |
556 |
samplerFollowRedirects.setName(ProxyControl.SAMPLER_FOLLOW_REDIRECTS); |
573 |
samplerFollowRedirects.setName(ProxyControl.SAMPLER_FOLLOW_REDIRECTS); |
557 |
samplerFollowRedirects.setSelected(true); |
574 |
samplerFollowRedirects.setSelected(true); |
558 |
samplerFollowRedirects.addActionListener(this); |
575 |
samplerFollowRedirects.addActionListener(this); |
559 |
samplerFollowRedirects.setActionCommand(ProxyControl.SAMPLER_FOLLOW_REDIRECTS); |
576 |
samplerFollowRedirects.setActionCommand(ProxyControl.SAMPLER_FOLLOW_REDIRECTS); |
560 |
|
577 |
|
561 |
useKeepAlive = new JCheckBox(JMeterUtils.getResString("proxy_usekeepalive")); |
578 |
useKeepAlive = new JCheckBox(JMeterUtils.getResString("use_keepalive")); |
562 |
useKeepAlive.setName(ProxyControl.USE_KEEPALIVE); |
579 |
useKeepAlive.setName(ProxyControl.USE_KEEPALIVE); |
563 |
useKeepAlive.setSelected(true); |
580 |
useKeepAlive.setSelected(true); |
564 |
useKeepAlive.addActionListener(this); |
581 |
useKeepAlive.addActionListener(this); |
565 |
useKeepAlive.setActionCommand(ProxyControl.USE_KEEPALIVE); |
582 |
useKeepAlive.setActionCommand(ProxyControl.USE_KEEPALIVE); |
566 |
|
583 |
|
567 |
samplerDownloadImages = new JCheckBox("Download images"); |
584 |
samplerDownloadImages = new JCheckBox(JMeterUtils.getResString("web_testing_retrieve_images")); |
568 |
samplerDownloadImages.setName(ProxyControl.SAMPLER_DOWNLOAD_IMAGES); |
585 |
samplerDownloadImages.setName(ProxyControl.SAMPLER_DOWNLOAD_IMAGES); |
569 |
samplerDownloadImages.setSelected(false); |
586 |
samplerDownloadImages.setSelected(false); |
570 |
samplerDownloadImages.addActionListener(this); |
587 |
samplerDownloadImages.addActionListener(this); |
571 |
samplerDownloadImages.setActionCommand(ProxyControl.SAMPLER_DOWNLOAD_IMAGES); |
588 |
samplerDownloadImages.setActionCommand(ProxyControl.SAMPLER_DOWNLOAD_IMAGES); |
572 |
|
589 |
|
573 |
HorizontalPanel panel = new HorizontalPanel(); |
590 |
HorizontalPanel panel = new HorizontalPanel(); |
574 |
panel.add(label); |
591 |
panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), |
|
|
592 |
JMeterUtils.getResString("proxy_sampler_settings"))); |
575 |
panel.add(label2); |
593 |
panel.add(label2); |
576 |
panel.add(samplerTypeName); |
594 |
panel.add(samplerTypeName); |
577 |
panel.add(samplerRedirectAutomatically); |
595 |
panel.add(samplerRedirectAutomatically); |
Lines 646-652
Link Here
|
646 |
|
664 |
|
647 |
return panel; |
665 |
return panel; |
648 |
} |
666 |
} |
|
|
667 |
|
668 |
private JPanel createContentTypePanel() { |
669 |
contentTypeInclude = new JTextField(30); |
670 |
contentTypeInclude.setName(ProxyControl.CONTENT_TYPE_INCLUDE); |
671 |
contentTypeInclude.addActionListener(this); |
672 |
contentTypeInclude.setActionCommand(ProxyControl.CONTENT_TYPE_INCLUDE); |
673 |
JLabel labelInclude = new JLabel(JMeterUtils.getResString("proxy_content_type_include")); |
674 |
labelInclude.setLabelFor(contentTypeInclude); |
675 |
// Default value |
676 |
contentTypeInclude.setText(JMeterUtils.getProperty("proxy.content_type_include")); |
649 |
|
677 |
|
|
|
678 |
contentTypeExclude = new JTextField(30); |
679 |
contentTypeExclude.setName(ProxyControl.CONTENT_TYPE_EXCLUDE); |
680 |
contentTypeExclude.addActionListener(this); |
681 |
contentTypeExclude.setActionCommand(ProxyControl.CONTENT_TYPE_EXCLUDE); |
682 |
JLabel labelExclude = new JLabel(JMeterUtils.getResString("proxy_content_type_exclude")); |
683 |
labelExclude.setLabelFor(contentTypeExclude); |
684 |
// Default value |
685 |
contentTypeExclude.setText(JMeterUtils.getProperty("proxy.content_type_exclude")); |
686 |
|
687 |
HorizontalPanel panel = new HorizontalPanel(); |
688 |
panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), |
689 |
JMeterUtils.getResString("proxy_content_type_filter"))); |
690 |
panel.add(labelInclude); |
691 |
panel.add(contentTypeInclude); |
692 |
panel.add(labelExclude); |
693 |
panel.add(contentTypeExclude); |
694 |
|
695 |
return panel; |
696 |
} |
697 |
|
650 |
private JPanel createIncludePanel() { |
698 |
private JPanel createIncludePanel() { |
651 |
includeModel = new PowerTableModel(new String[] { INCLUDE_COL }, new Class[] { String.class }); |
699 |
includeModel = new PowerTableModel(new String[] { INCLUDE_COL }, new Class[] { String.class }); |
652 |
includeTable = new JTable(includeModel); |
700 |
includeTable = new JTable(includeModel); |