Author: sebb
Date: Fri Nov 16 16:09:38 2007
New Revision: 595878
URL: http://svn.apache.org/viewvc?rev=595878&view=rev
Log:
Add https spoof match field to GUI
Tidy GUI; privatise JMX names
Modified:
jakarta/jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java
Modified:
jakarta/jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
URL:
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties?rev=595878&r1=595877&r2=595878&view=diff
==============================================================================
---
jakarta/jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
(original)
+++
jakarta/jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
Fri Nov 16 16:09:38 2007
@@ -525,7 +525,8 @@
proxy_content_type_filter=Content-type filter
proxy_content_type_include=Include\:
proxy_headers=Capture HTTP Headers
-proxy_httpsspoofing=Attempt https Spoofing
+proxy_httpsspoofing=Attempt HTTPS Spoofing
+proxy_httpsspoofing_match=Optional URL match string:
proxy_regex=Regex matching
proxy_sampler_settings=HTTP Sampler settings
proxy_sampler_type=Type\:
Modified:
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
URL:
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java?rev=595878&r1=595877&r2=595878&view=diff
==============================================================================
---
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
(original)
+++
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
Fri Nov 16 16:09:38 2007
@@ -87,35 +87,39 @@
public static final String DEFAULT_PORT_S =
Integer.toString(DEFAULT_PORT);// Used by GUI
- public static final String PORT = "ProxyControlGui.port"; // $NON-NLS-1$
+ //+ JMX file attributes
+ private static final String PORT = "ProxyControlGui.port"; //
$NON-NLS-1$
- public static final String EXCLUDE_LIST =
"ProxyControlGui.exclude_list"; // $NON-NLS-1$
+ private static final String EXCLUDE_LIST =
"ProxyControlGui.exclude_list"; // $NON-NLS-1$
- public static final String INCLUDE_LIST =
"ProxyControlGui.include_list"; // $NON-NLS-1$
+ private static final String INCLUDE_LIST =
"ProxyControlGui.include_list"; // $NON-NLS-1$
- public static final String CAPTURE_HTTP_HEADERS =
"ProxyControlGui.capture_http_headers"; // $NON-NLS-1$
+ private static final String CAPTURE_HTTP_HEADERS =
"ProxyControlGui.capture_http_headers"; // $NON-NLS-1$
- public static final String ADD_ASSERTIONS =
"ProxyControlGui.add_assertion"; // $NON-NLS-1$
+ private static final String ADD_ASSERTIONS =
"ProxyControlGui.add_assertion"; // $NON-NLS-1$
- public static final String GROUPING_MODE =
"ProxyControlGui.grouping_mode"; // $NON-NLS-1$
+ private static final String GROUPING_MODE =
"ProxyControlGui.grouping_mode"; // $NON-NLS-1$
- public static final String SAMPLER_TYPE_NAME =
"ProxyControlGui.sampler_type_name"; // $NON-NLS-1$
+ private static final String SAMPLER_TYPE_NAME =
"ProxyControlGui.sampler_type_name"; // $NON-NLS-1$
- public static final String SAMPLER_REDIRECT_AUTOMATICALLY =
"ProxyControlGui.sampler_redirect_automatically"; // $NON-NLS-1$
+ private static final String SAMPLER_REDIRECT_AUTOMATICALLY =
"ProxyControlGui.sampler_redirect_automatically"; // $NON-NLS-1$
- public static final String SAMPLER_FOLLOW_REDIRECTS =
"ProxyControlGui.sampler_follow_redirects"; // $NON-NLS-1$
+ private static final String SAMPLER_FOLLOW_REDIRECTS =
"ProxyControlGui.sampler_follow_redirects"; // $NON-NLS-1$
- public static final String USE_KEEPALIVE =
"ProxyControlGui.use_keepalive"; // $NON-NLS-1$
+ private static final String USE_KEEPALIVE =
"ProxyControlGui.use_keepalive"; // $NON-NLS-1$
- public static final String SAMPLER_DOWNLOAD_IMAGES =
"ProxyControlGui.sampler_download_images"; // $NON-NLS-1$
+ private static final String SAMPLER_DOWNLOAD_IMAGES =
"ProxyControlGui.sampler_download_images"; // $NON-NLS-1$
- public static final String REGEX_MATCH = "ProxyControlGui.regex_match";
// $NON-NLS-1$
+ private static final String REGEX_MATCH =
"ProxyControlGui.regex_match"; // $NON-NLS-1$
- public static final String HTTPS_SPOOF = "ProxyControlGui.https_spoof";
+ private static final String HTTPS_SPOOF =
"ProxyControlGui.https_spoof"; // $NON-NLS-1$
- public static final String CONTENT_TYPE_EXCLUDE =
"ProxyControlGui.content_type_exclude"; // $NON-NLS-1$
+ private static final String HTTPS_SPOOF_MATCH =
"ProxyControlGui.https_spoof_match"; // $NON-NLS-1$
- public static final String CONTENT_TYPE_INCLUDE =
"ProxyControlGui.content_type_include"; // $NON-NLS-1$
+ private static final String CONTENT_TYPE_EXCLUDE =
"ProxyControlGui.content_type_exclude"; // $NON-NLS-1$
+
+ private static final String CONTENT_TYPE_INCLUDE =
"ProxyControlGui.content_type_include"; // $NON-NLS-1$
+ //- JMX file attributes
public static final int GROUPING_NO_GROUPS = 0;
@@ -229,13 +233,14 @@
setProperty(new BooleanProperty(REGEX_MATCH, b));
}
- /**
- * @param b
- */
public void setHttpsSpoof(boolean b) {
setProperty(new BooleanProperty(HTTPS_SPOOF, b));
}
+ public void setHttpsSpoofMatch(String s) {
+ setProperty(new StringProperty(HTTPS_SPOOF_MATCH, s));
+ }
+
public void setContentTypeExclude(String contentTypeExclude) {
setProperty(new StringProperty(CONTENT_TYPE_EXCLUDE,
contentTypeExclude));
}
@@ -298,6 +303,10 @@
public boolean getHttpsSpoof() {
return getPropertyAsBoolean(HTTPS_SPOOF, false);
+ }
+
+ public String getHttpsSpoofMatch() {
+ return getPropertyAsString(HTTPS_SPOOF_MATCH, "");
}
public String getContentTypeExclude() {
Modified:
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java
URL:
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java?rev=595878&r1=595877&r2=595878&view=diff
==============================================================================
---
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java
(original)
+++
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java
Fri Nov 16 16:09:38 2007
@@ -127,6 +127,8 @@
*/
private JCheckBox httpsSpoof;
+ private JTextField httpsMatch;
+
/**
* Regular expression to include results based on content type
*/
@@ -158,12 +160,15 @@
private JButton stop, start, restart;
+ //+ action names
private static final String STOP = "stop"; // $NON-NLS-1$
private static final String START = "start"; // $NON-NLS-1$
private static final String RESTART = "restart"; // $NON-NLS-1$
+ private static final String ENABLE_RESTART = "enable_restart"; //
$NON-NLS-1$
+
private static final String ADD_INCLUDE = "add_include"; // $NON-NLS-1$
private static final String ADD_EXCLUDE = "add_exclude"; // $NON-NLS-1$
@@ -171,11 +176,15 @@
private static final String DELETE_INCLUDE = "delete_include"; //
$NON-NLS-1$
private static final String DELETE_EXCLUDE = "delete_exclude"; //
$NON-NLS-1$
+ //- action names
private static final String INCLUDE_COL =
JMeterUtils.getResString("patterns_to_include"); // $NON-NLS-1$
private static final String EXCLUDE_COL =
JMeterUtils.getResString("patterns_to_exclude"); // $NON-NLS-1$
+ // Used by itemListener
+ private static final String PORTFIELD = "portField"; // $NON-NLS-1$
+
public ProxyControlGui() {
super();
log.debug("Creating ProxyControlGui");
@@ -222,6 +231,7 @@
model.setSamplerDownloadImages(samplerDownloadImages.isSelected());
model.setRegexMatch(regexMatch.isSelected());
model.setHttpsSpoof(httpsSpoof.isSelected());
+ model.setHttpsSpoofMatch(httpsMatch.getText());
model.setContentTypeInclude(contentTypeInclude.getText());
model.setContentTypeExclude(contentTypeExclude.getText());
TreeNodeWrapper nw = (TreeNodeWrapper)
targetNodes.getSelectedItem();
@@ -275,6 +285,7 @@
samplerDownloadImages.setSelected(model.getSamplerDownloadImages());
regexMatch.setSelected(model.getRegexMatch());
httpsSpoof.setSelected(model.getHttpsSpoof());
+ httpsMatch.setText(model.getHttpsSpoofMatch());
contentTypeInclude.setText(model.getContentTypeInclude());
contentTypeExclude.setText(model.getContentTypeExclude());
@@ -297,6 +308,7 @@
/*
* Handles groupingMode. actionPerfomed is not suitable, as that seems
to be
* activated whenever the Proxy is selected in the Test Plan
+ * Also handles samplerTypeName
*/
public void itemStateChanged(ItemEvent e) {
// System.err.println(e.paramString());
@@ -325,16 +337,7 @@
} else if (command.equals(RESTART)) {
model.stopProxy();
startProxy();
- } else if (command.equals(ProxyControl.CAPTURE_HTTP_HEADERS)
- || command.equals(ProxyControl.ADD_ASSERTIONS)
- ||
command.equals(ProxyControl.SAMPLER_REDIRECT_AUTOMATICALLY)
- ||
command.equals(ProxyControl.SAMPLER_FOLLOW_REDIRECTS)
- || command.equals(ProxyControl.USE_KEEPALIVE)
- ||
command.equals(ProxyControl.SAMPLER_DOWNLOAD_IMAGES)
- || command.equals(ProxyControl.REGEX_MATCH)
- || command.equals(ProxyControl.HTTPS_SPOOF)
- ||
command.equals(ProxyControl.CONTENT_TYPE_INCLUDE)
- ||
command.equals(ProxyControl.CONTENT_TYPE_EXCLUDE)) {
+ } else if (command.equals(ENABLE_RESTART)){
enableRestart();
} else if (command.equals(ADD_EXCLUDE)) {
excludeModel.addNewRow();
@@ -412,7 +415,7 @@
public void keyReleased(KeyEvent e) {
String fieldName = e.getComponent().getName();
- if (fieldName.equals(ProxyControl.PORT)) {
+ if (fieldName.equals(PORTFIELD)) {
try {
Integer.parseInt(portField.getText());
} catch (NumberFormatException nfe) {
@@ -425,6 +428,8 @@
}
}
enableRestart();
+ } else if (fieldName.equals(ENABLE_RESTART)){
+ enableRestart();
}
}
@@ -482,17 +487,23 @@
private JPanel createPortPanel() {
portField = new JTextField(ProxyControl.DEFAULT_PORT_S, 8);
- portField.setName(ProxyControl.PORT);
+ portField.setName(PORTFIELD);
portField.addKeyListener(this);
JLabel label = new JLabel(JMeterUtils.getResString("port")); //
$NON-NLS-1$
label.setLabelFor(portField);
httpsSpoof = new
JCheckBox(JMeterUtils.getResString("proxy_httpsspoofing")); // $NON-NLS-1$
- httpsSpoof.setName(ProxyControl.HTTPS_SPOOF);
httpsSpoof.setSelected(false);
httpsSpoof.addActionListener(this);
- httpsSpoof.setActionCommand(ProxyControl.HTTPS_SPOOF);
+ httpsSpoof.setActionCommand(ENABLE_RESTART);
+
+ httpsMatch = new JTextField(20);
+ httpsMatch.addKeyListener(this);
+ httpsMatch.setName(ENABLE_RESTART);
+
+ JLabel matchlabel = new
JLabel(JMeterUtils.getResString("proxy_httpsspoofing_match")); // $NON-NLS-1$
+ matchlabel.setLabelFor(httpsMatch);
HorizontalPanel panel = new HorizontalPanel();
panel.add(label);
@@ -501,27 +512,27 @@
panel.add(Box.createHorizontalStrut(10));
panel.add(httpsSpoof);
+ panel.add(matchlabel);
+ panel.add(httpsMatch);
+
return panel;
}
private JPanel createTestPlanContentPanel() {
httpHeaders = new
JCheckBox(JMeterUtils.getResString("proxy_headers")); // $NON-NLS-1$
- httpHeaders.setName(ProxyControl.CAPTURE_HTTP_HEADERS);
httpHeaders.setSelected(true); // maintain original default
httpHeaders.addActionListener(this);
- httpHeaders.setActionCommand(ProxyControl.CAPTURE_HTTP_HEADERS);
+ httpHeaders.setActionCommand(ENABLE_RESTART);
addAssertions = new
JCheckBox(JMeterUtils.getResString("proxy_assertions")); // $NON-NLS-1$
- addAssertions.setName(ProxyControl.ADD_ASSERTIONS);
addAssertions.setSelected(false);
addAssertions.addActionListener(this);
- addAssertions.setActionCommand(ProxyControl.ADD_ASSERTIONS);
+ addAssertions.setActionCommand(ENABLE_RESTART);
regexMatch = new
JCheckBox(JMeterUtils.getResString("proxy_regex")); // $NON-NLS-1$
- regexMatch.setName(ProxyControl.REGEX_MATCH);
regexMatch.setSelected(false);
regexMatch.addActionListener(this);
- regexMatch.setActionCommand(ProxyControl.REGEX_MATCH);
+ regexMatch.setActionCommand(ENABLE_RESTART);
VerticalPanel mainPanel = new VerticalPanel();
mainPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),
@@ -546,35 +557,30 @@
m.addElement(JMeterUtils.getResString("web_testing_title")); //
$NON-NLS-1$
m.addElement(JMeterUtils.getResString("web_testing2_title"));
// $NON-NLS-1$
samplerTypeName = new JComboBox(m);
- samplerTypeName.setName(ProxyControl.SAMPLER_TYPE_NAME);
samplerTypeName.setSelectedIndex(0);
samplerTypeName.addItemListener(this);
JLabel label2 = new
JLabel(JMeterUtils.getResString("proxy_sampler_type")); // $NON-NLS-1$
label2.setLabelFor(samplerTypeName);
samplerRedirectAutomatically = new
JCheckBox(JMeterUtils.getResString("follow_redirects_auto")); // $NON-NLS-1$
-
samplerRedirectAutomatically.setName(ProxyControl.SAMPLER_REDIRECT_AUTOMATICALLY);
samplerRedirectAutomatically.setSelected(false);
samplerRedirectAutomatically.addActionListener(this);
-
samplerRedirectAutomatically.setActionCommand(ProxyControl.SAMPLER_REDIRECT_AUTOMATICALLY);
+ samplerRedirectAutomatically.setActionCommand(ENABLE_RESTART);
samplerFollowRedirects = new
JCheckBox(JMeterUtils.getResString("follow_redirects")); // $NON-NLS-1$
-
samplerFollowRedirects.setName(ProxyControl.SAMPLER_FOLLOW_REDIRECTS);
samplerFollowRedirects.setSelected(true);
samplerFollowRedirects.addActionListener(this);
-
samplerFollowRedirects.setActionCommand(ProxyControl.SAMPLER_FOLLOW_REDIRECTS);
+ samplerFollowRedirects.setActionCommand(ENABLE_RESTART);
useKeepAlive = new
JCheckBox(JMeterUtils.getResString("use_keepalive")); // $NON-NLS-1$
- useKeepAlive.setName(ProxyControl.USE_KEEPALIVE);
useKeepAlive.setSelected(true);
useKeepAlive.addActionListener(this);
- useKeepAlive.setActionCommand(ProxyControl.USE_KEEPALIVE);
+ useKeepAlive.setActionCommand(ENABLE_RESTART);
samplerDownloadImages = new
JCheckBox(JMeterUtils.getResString("web_testing_retrieve_images")); //
$NON-NLS-1$
-
samplerDownloadImages.setName(ProxyControl.SAMPLER_DOWNLOAD_IMAGES);
samplerDownloadImages.setSelected(false);
samplerDownloadImages.addActionListener(this);
-
samplerDownloadImages.setActionCommand(ProxyControl.SAMPLER_DOWNLOAD_IMAGES);
+ samplerDownloadImages.setActionCommand(ENABLE_RESTART);
HorizontalPanel panel = new HorizontalPanel();
panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),
@@ -640,7 +646,6 @@
m.addElement(JMeterUtils.getResString("grouping_in_controllers")); //
$NON-NLS-1$
m.addElement(JMeterUtils.getResString("grouping_store_first_only")); //
$NON-NLS-1$
groupingMode = new JComboBox(m);
- groupingMode.setName(ProxyControl.GROUPING_MODE);
groupingMode.setSelectedIndex(0);
groupingMode.addItemListener(this);
@@ -656,18 +661,16 @@
private JPanel createContentTypePanel() {
contentTypeInclude = new JTextField(30);
- contentTypeInclude.setName(ProxyControl.CONTENT_TYPE_INCLUDE);
- contentTypeInclude.addActionListener(this);
-
contentTypeInclude.setActionCommand(ProxyControl.CONTENT_TYPE_INCLUDE);
+ contentTypeInclude.addKeyListener(this);
+ contentTypeInclude.setName(ENABLE_RESTART);
JLabel labelInclude = new
JLabel(JMeterUtils.getResString("proxy_content_type_include")); // $NON-NLS-1$
labelInclude.setLabelFor(contentTypeInclude);
// Default value
contentTypeInclude.setText(JMeterUtils.getProperty("proxy.content_type_include"));
// $NON-NLS-1$
contentTypeExclude = new JTextField(30);
- contentTypeExclude.setName(ProxyControl.CONTENT_TYPE_EXCLUDE);
- contentTypeExclude.addActionListener(this);
-
contentTypeExclude.setActionCommand(ProxyControl.CONTENT_TYPE_EXCLUDE);
+ contentTypeExclude.addKeyListener(this);
+ contentTypeExclude.setName(ENABLE_RESTART);
JLabel labelExclude = new
JLabel(JMeterUtils.getResString("proxy_content_type_exclude")); // $NON-NLS-1$
labelExclude.setLabelFor(contentTypeExclude);
// Default value
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]