Lines 93-107
Link Here
|
93 |
*/ |
93 |
*/ |
94 |
private JCheckBox addAssertions; |
94 |
private JCheckBox addAssertions; |
95 |
|
95 |
|
|
|
96 |
/* |
97 |
* Use regexes to match the source data |
98 |
*/ |
99 |
private JCheckBox regexMatch; |
100 |
|
96 |
/** |
101 |
/** |
|
|
102 |
* The list of sampler type names to choose from |
103 |
*/ |
104 |
private JComboBox samplerTypeName; |
105 |
|
106 |
private DefaultComboBoxModel samplerTypeNameModel; |
107 |
|
108 |
/** |
109 |
* Set/clear the Redirect automatically box on the samplers (default is false) |
110 |
*/ |
111 |
private JCheckBox samplerRedirectAutomatically; |
112 |
/** |
113 |
* Set/clear the Follow-redirects box on the samplers (default is true) |
114 |
*/ |
115 |
private JCheckBox samplerFollowRedirects; |
116 |
|
117 |
/** |
97 |
* Set/clear the Use Keep-Alive box on the samplers (default is true) |
118 |
* Set/clear the Use Keep-Alive box on the samplers (default is true) |
98 |
*/ |
119 |
*/ |
99 |
private JCheckBox useKeepAlive; |
120 |
private JCheckBox useKeepAlive; |
100 |
|
121 |
|
101 |
/* |
122 |
/** |
102 |
* Use regexes to match the source data |
123 |
* Set/clear the Download images box on the samplers (default is false) |
103 |
*/ |
124 |
*/ |
104 |
private JCheckBox regexMatch; |
125 |
private JCheckBox samplerDownloadImages; |
105 |
|
126 |
|
106 |
/* |
127 |
/* |
107 |
* Spoof the client into thinking that it is communicating with http |
128 |
* Spoof the client into thinking that it is communicating with http |
Lines 181-187
Link Here
|
181 |
model.setCaptureHttpHeaders(httpHeaders.isSelected()); |
202 |
model.setCaptureHttpHeaders(httpHeaders.isSelected()); |
182 |
model.setGroupingMode(groupingMode.getSelectedIndex()); |
203 |
model.setGroupingMode(groupingMode.getSelectedIndex()); |
183 |
model.setAssertions(addAssertions.isSelected()); |
204 |
model.setAssertions(addAssertions.isSelected()); |
|
|
205 |
model.setSamplerTypeName(samplerTypeName.getSelectedIndex()); |
206 |
model.setSamplerRedirectAutomatically(samplerRedirectAutomatically.isSelected()); |
207 |
model.setSamplerFollowRedirects(samplerFollowRedirects.isSelected()); |
184 |
model.setUseKeepAlive(useKeepAlive.isSelected()); |
208 |
model.setUseKeepAlive(useKeepAlive.isSelected()); |
|
|
209 |
model.setSamplerDownloadImages(samplerDownloadImages.isSelected()); |
185 |
model.setRegexMatch(regexMatch.isSelected()); |
210 |
model.setRegexMatch(regexMatch.isSelected()); |
186 |
model.setHttpsSpoof(httpsSpoof.isSelected()); |
211 |
model.setHttpsSpoof(httpsSpoof.isSelected()); |
187 |
TreeNodeWrapper nw = (TreeNodeWrapper) targetNodes.getSelectedItem(); |
212 |
TreeNodeWrapper nw = (TreeNodeWrapper) targetNodes.getSelectedItem(); |
Lines 228-234
Link Here
|
228 |
httpHeaders.setSelected(model.getCaptureHttpHeaders()); |
253 |
httpHeaders.setSelected(model.getCaptureHttpHeaders()); |
229 |
groupingMode.setSelectedIndex(model.getGroupingMode()); |
254 |
groupingMode.setSelectedIndex(model.getGroupingMode()); |
230 |
addAssertions.setSelected(model.getAssertions()); |
255 |
addAssertions.setSelected(model.getAssertions()); |
|
|
256 |
samplerTypeName.setSelectedIndex(model.getSamplerTypeName()); |
257 |
samplerRedirectAutomatically.setSelected(model.getSamplerRedirectAutomatically()); |
258 |
samplerFollowRedirects.setSelected(model.getSamplerFollowRedirects()); |
231 |
useKeepAlive.setSelected(model.getUseKeepalive()); |
259 |
useKeepAlive.setSelected(model.getUseKeepalive()); |
|
|
260 |
samplerDownloadImages.setSelected(model.getSamplerDownloadImages()); |
232 |
regexMatch.setSelected(model.getRegexMatch()); |
261 |
regexMatch.setSelected(model.getRegexMatch()); |
233 |
httpsSpoof.setSelected(model.getHttpsSpoof()); |
262 |
httpsSpoof.setSelected(model.getHttpsSpoof()); |
234 |
|
263 |
|
Lines 290-297
Link Here
|
290 |
model.stopProxy(); |
319 |
model.stopProxy(); |
291 |
startProxy(); |
320 |
startProxy(); |
292 |
} else if (command.equals(ProxyControl.CAPTURE_HTTP_HEADERS) || command.equals(ProxyControl.ADD_ASSERTIONS) |
321 |
} else if (command.equals(ProxyControl.CAPTURE_HTTP_HEADERS) || command.equals(ProxyControl.ADD_ASSERTIONS) |
293 |
|| command.equals(ProxyControl.USE_KEEPALIVE) || command.equals(ProxyControl.REGEX_MATCH) |
322 |
|| command.equals(ProxyControl.SAMPLER_REDIRECT_AUTOMATICALLY) |
294 |
|| command.equals(ProxyControl.HTTPS_SPOOF)) { |
323 |
|| command.equals(ProxyControl.SAMPLER_FOLLOW_REDIRECTS) |
|
|
324 |
|| command.equals(ProxyControl.USE_KEEPALIVE) || command.equals(ProxyControl.SAMPLER_DOWNLOAD_IMAGES) |
325 |
|| command.equals(ProxyControl.REGEX_MATCH) || command.equals(ProxyControl.HTTPS_SPOOF)) { |
295 |
enableRestart(); |
326 |
enableRestart(); |
296 |
} else if (command.equals(ADD_EXCLUDE)) { |
327 |
} else if (command.equals(ADD_EXCLUDE)) { |
297 |
excludeModel.addNewRow(); |
328 |
excludeModel.addNewRow(); |
Lines 400-405
Link Here
|
400 |
Box myBox = Box.createVerticalBox(); |
431 |
Box myBox = Box.createVerticalBox(); |
401 |
myBox.add(createPortPanel()); |
432 |
myBox.add(createPortPanel()); |
402 |
myBox.add(Box.createVerticalStrut(5)); |
433 |
myBox.add(Box.createVerticalStrut(5)); |
|
|
434 |
myBox.add(createTestPlanContentPanel()); |
435 |
myBox.add(Box.createVerticalStrut(5)); |
436 |
myBox.add(createHTTPSamplerPanel()); |
437 |
myBox.add(Box.createVerticalStrut(5)); |
403 |
myBox.add(createTargetPanel()); |
438 |
myBox.add(createTargetPanel()); |
404 |
myBox.add(Box.createVerticalStrut(5)); |
439 |
myBox.add(Box.createVerticalStrut(5)); |
405 |
myBox.add(createGroupingPanel()); |
440 |
myBox.add(createGroupingPanel()); |
Lines 447-452
Link Here
|
447 |
JLabel label = new JLabel(JMeterUtils.getResString("port")); |
482 |
JLabel label = new JLabel(JMeterUtils.getResString("port")); |
448 |
label.setLabelFor(portField); |
483 |
label.setLabelFor(portField); |
449 |
|
484 |
|
|
|
485 |
httpsSpoof = new JCheckBox(JMeterUtils.getResString("proxy_httpsspoofing")); |
486 |
httpsSpoof.setName(ProxyControl.HTTPS_SPOOF); |
487 |
httpsSpoof.setSelected(false); |
488 |
httpsSpoof.addActionListener(this); |
489 |
httpsSpoof.setActionCommand(ProxyControl.HTTPS_SPOOF); |
490 |
|
491 |
HorizontalPanel panel = new HorizontalPanel(); |
492 |
panel.add(label); |
493 |
panel.add(portField); |
494 |
|
495 |
panel.add(Box.createHorizontalStrut(10)); |
496 |
panel.add(httpsSpoof); |
497 |
|
498 |
return panel; |
499 |
} |
500 |
|
501 |
private JPanel createTestPlanContentPanel() { |
502 |
JLabel label = new JLabel("Test plan content:"); |
503 |
|
450 |
httpHeaders = new JCheckBox(JMeterUtils.getResString("proxy_headers")); |
504 |
httpHeaders = new JCheckBox(JMeterUtils.getResString("proxy_headers")); |
451 |
httpHeaders.setName(ProxyControl.CAPTURE_HTTP_HEADERS); |
505 |
httpHeaders.setName(ProxyControl.CAPTURE_HTTP_HEADERS); |
452 |
httpHeaders.setSelected(true); // maintain original default |
506 |
httpHeaders.setSelected(true); // maintain original default |
Lines 459-497
Link Here
|
459 |
addAssertions.addActionListener(this); |
513 |
addAssertions.addActionListener(this); |
460 |
addAssertions.setActionCommand(ProxyControl.ADD_ASSERTIONS); |
514 |
addAssertions.setActionCommand(ProxyControl.ADD_ASSERTIONS); |
461 |
|
515 |
|
462 |
useKeepAlive = new JCheckBox(JMeterUtils.getResString("proxy_usekeepalive")); |
|
|
463 |
useKeepAlive.setName(ProxyControl.USE_KEEPALIVE); |
464 |
useKeepAlive.setSelected(true); |
465 |
useKeepAlive.addActionListener(this); |
466 |
useKeepAlive.setActionCommand(ProxyControl.USE_KEEPALIVE); |
467 |
|
468 |
regexMatch = new JCheckBox(JMeterUtils.getResString("proxy_regex")); |
516 |
regexMatch = new JCheckBox(JMeterUtils.getResString("proxy_regex")); |
469 |
regexMatch.setName(ProxyControl.REGEX_MATCH); |
517 |
regexMatch.setName(ProxyControl.REGEX_MATCH); |
470 |
regexMatch.setSelected(false); |
518 |
regexMatch.setSelected(false); |
471 |
regexMatch.addActionListener(this); |
519 |
regexMatch.addActionListener(this); |
472 |
regexMatch.setActionCommand(ProxyControl.REGEX_MATCH); |
520 |
regexMatch.setActionCommand(ProxyControl.REGEX_MATCH); |
473 |
|
521 |
|
474 |
httpsSpoof = new JCheckBox(JMeterUtils.getResString("proxy_httpsspoofing")); |
|
|
475 |
httpsSpoof.setName(ProxyControl.HTTPS_SPOOF); |
476 |
httpsSpoof.setSelected(false); |
477 |
httpsSpoof.addActionListener(this); |
478 |
httpsSpoof.setActionCommand(ProxyControl.HTTPS_SPOOF); |
479 |
|
480 |
HorizontalPanel panel = new HorizontalPanel(); |
522 |
HorizontalPanel panel = new HorizontalPanel(); |
481 |
panel.add(label); |
523 |
panel.add(label); |
482 |
panel.add(portField); |
|
|
483 |
|
524 |
|
484 |
panel.add(Box.createHorizontalStrut(10)); |
|
|
485 |
panel.add(httpHeaders); |
525 |
panel.add(httpHeaders); |
486 |
|
|
|
487 |
panel.add(useKeepAlive); |
488 |
panel.add(addAssertions); |
526 |
panel.add(addAssertions); |
489 |
panel.add(regexMatch); |
527 |
panel.add(regexMatch); |
490 |
panel.add(httpsSpoof); |
|
|
491 |
|
528 |
|
492 |
return panel; |
529 |
return panel; |
493 |
} |
530 |
} |
494 |
|
531 |
|
|
|
532 |
private JPanel createHTTPSamplerPanel() { |
533 |
JLabel label = new JLabel("HTTP Sampler settings:"); |
534 |
|
535 |
DefaultComboBoxModel m = new DefaultComboBoxModel(); |
536 |
// Note: position of these elements in the menu *must* match the |
537 |
// corresponding ProxyControl.SAMPLER_TYPE_* values. |
538 |
m.addElement(JMeterUtils.getResString("web_request")); |
539 |
m.addElement(JMeterUtils.getResString("web_request") + " HTTPClient"); |
540 |
samplerTypeName = new JComboBox(m); |
541 |
samplerTypeName.setName(ProxyControl.SAMPLER_TYPE_NAME); |
542 |
samplerTypeName.setSelectedIndex(0); |
543 |
samplerTypeName.addItemListener(this); |
544 |
JLabel label2 = new JLabel("Type:"); |
545 |
label2.setLabelFor(samplerTypeName); |
546 |
|
547 |
samplerRedirectAutomatically = new JCheckBox("Redirect automatically"); |
548 |
samplerRedirectAutomatically.setName(ProxyControl.SAMPLER_REDIRECT_AUTOMATICALLY); |
549 |
samplerRedirectAutomatically.setSelected(false); |
550 |
samplerRedirectAutomatically.addActionListener(this); |
551 |
samplerRedirectAutomatically.setActionCommand(ProxyControl.SAMPLER_REDIRECT_AUTOMATICALLY); |
552 |
|
553 |
samplerFollowRedirects = new JCheckBox("Follow redirects"); |
554 |
samplerFollowRedirects.setName(ProxyControl.SAMPLER_FOLLOW_REDIRECTS); |
555 |
samplerFollowRedirects.setSelected(true); |
556 |
samplerFollowRedirects.addActionListener(this); |
557 |
samplerFollowRedirects.setActionCommand(ProxyControl.SAMPLER_FOLLOW_REDIRECTS); |
558 |
|
559 |
useKeepAlive = new JCheckBox(JMeterUtils.getResString("proxy_usekeepalive")); |
560 |
useKeepAlive.setName(ProxyControl.USE_KEEPALIVE); |
561 |
useKeepAlive.setSelected(true); |
562 |
useKeepAlive.addActionListener(this); |
563 |
useKeepAlive.setActionCommand(ProxyControl.USE_KEEPALIVE); |
564 |
|
565 |
samplerDownloadImages = new JCheckBox("Download images"); |
566 |
samplerDownloadImages.setName(ProxyControl.SAMPLER_DOWNLOAD_IMAGES); |
567 |
samplerDownloadImages.setSelected(false); |
568 |
samplerDownloadImages.addActionListener(this); |
569 |
samplerDownloadImages.setActionCommand(ProxyControl.SAMPLER_DOWNLOAD_IMAGES); |
570 |
|
571 |
HorizontalPanel panel = new HorizontalPanel(); |
572 |
panel.add(label); |
573 |
panel.add(label2); |
574 |
panel.add(samplerTypeName); |
575 |
panel.add(samplerRedirectAutomatically); |
576 |
panel.add(samplerFollowRedirects); |
577 |
panel.add(useKeepAlive); |
578 |
panel.add(samplerDownloadImages); |
579 |
|
580 |
return panel; |
581 |
} |
582 |
|
495 |
private JPanel createTargetPanel() { |
583 |
private JPanel createTargetPanel() { |
496 |
targetNodesModel = new DefaultComboBoxModel(); |
584 |
targetNodesModel = new DefaultComboBoxModel(); |
497 |
targetNodes = new JComboBox(targetNodesModel); |
585 |
targetNodes = new JComboBox(targetNodesModel); |
Lines 560-566
Link Here
|
560 |
private JPanel createIncludePanel() { |
648 |
private JPanel createIncludePanel() { |
561 |
includeModel = new PowerTableModel(new String[] { INCLUDE_COL }, new Class[] { String.class }); |
649 |
includeModel = new PowerTableModel(new String[] { INCLUDE_COL }, new Class[] { String.class }); |
562 |
includeTable = new JTable(includeModel); |
650 |
includeTable = new JTable(includeModel); |
563 |
includeTable.setPreferredScrollableViewportSize(new Dimension(100, 50)); |
651 |
includeTable.setPreferredScrollableViewportSize(new Dimension(100, 30)); |
564 |
includeTable.addFocusListener(this); |
652 |
includeTable.addFocusListener(this); |
565 |
|
653 |
|
566 |
JPanel panel = new JPanel(new BorderLayout()); |
654 |
JPanel panel = new JPanel(new BorderLayout()); |
Lines 576-582
Link Here
|
576 |
private JPanel createExcludePanel() { |
664 |
private JPanel createExcludePanel() { |
577 |
excludeModel = new PowerTableModel(new String[] { EXCLUDE_COL }, new Class[] { String.class }); |
665 |
excludeModel = new PowerTableModel(new String[] { EXCLUDE_COL }, new Class[] { String.class }); |
578 |
excludeTable = new JTable(excludeModel); |
666 |
excludeTable = new JTable(excludeModel); |
579 |
excludeTable.setPreferredScrollableViewportSize(new Dimension(100, 50)); |
667 |
excludeTable.setPreferredScrollableViewportSize(new Dimension(100, 30)); |
580 |
excludeTable.addFocusListener(this); |
668 |
excludeTable.addFocusListener(this); |
581 |
|
669 |
|
582 |
JPanel panel = new JPanel(new BorderLayout()); |
670 |
JPanel panel = new JPanel(new BorderLayout()); |