ASF Bugzilla – Attachment 23118 Details for
Bug 46436
Improve error reporting in Proxy Gui
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch_bug46436.txt
patch_bug46436.txt (text/plain), 3.69 KB, created by
Rose-Line Werner
on 2009-01-14 07:28:37 UTC
(
hide
)
Description:
patch_bug46436.txt
Filename:
MIME Type:
Creator:
Rose-Line Werner
Created:
2009-01-14 07:28:37 UTC
Size:
3.69 KB
patch
obsolete
>Index: /src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java >=================================================================== >--- /src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java (revision 734176) >+++ /src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java (working copy) >@@ -156,6 +156,14 @@ > private boolean samplerDownloadImages; > > private boolean regexMatch = false;// Should we match using regexes? >+ >+ /* >+ * Is JMeter running in Gui mode? >+ * Set by org.apache.jmeter.protocol.http.proxy.gui.ProxyControlGui >+ */ >+ private boolean inGuiMode = false; >+ >+ > > /** > * Tree node where the samples should be stored. >@@ -955,4 +963,18 @@ > public boolean canRemove() { > return null == server; > } >+ >+ /** >+ * @return the inGuiMode >+ */ >+ public boolean isInGuiMode() { >+ return inGuiMode; >+ } >+ >+ /** >+ * @param inGuiMode the inGuiMode to set >+ */ >+ public void setInGuiMode(boolean inGuiMode) { >+ this.inGuiMode = inGuiMode; >+ } > } >Index: /src/protocol/http/org/apache/jmeter/protocol/http/proxy/Daemon.java >=================================================================== >--- /src/protocol/http/org/apache/jmeter/protocol/http/proxy/Daemon.java (revision 734176) >+++ /src/protocol/http/org/apache/jmeter/protocol/http/proxy/Daemon.java (working copy) >@@ -19,12 +19,15 @@ > package org.apache.jmeter.protocol.http.proxy; > > import java.io.InterruptedIOException; >+import java.net.BindException; > import java.net.ServerSocket; > import java.net.Socket; > import java.util.Collections; > import java.util.HashMap; > import java.util.Map; > >+import javax.swing.JOptionPane; >+ > import org.apache.jorphan.logging.LoggingManager; > import org.apache.jorphan.util.JOrphanUtils; > import org.apache.log.Logger; >@@ -153,6 +156,16 @@ > } > } > log.info("Proxy Server stopped"); >+ >+ } catch(BindException e){ >+ // daemon port already in use >+ log.warn("Proxy Server stopped", e); >+ log.error("Port " + daemonPort + " already in use. Choose a different one for the proxy."); >+ >+ //TODO: alert in console mode, too >+ if(target.isInGuiMode()){ >+ JOptionPane.showMessageDialog(null, "Port " + daemonPort + " already in use. Choose a different one for the proxy.", "Proxy Server Port", JOptionPane.ERROR_MESSAGE); >+ } > } catch (Exception e) { > log.warn("Proxy Server stopped", e); > } finally { >Index: /src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java >=================================================================== >--- /src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java (revision 734176) >+++ /src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java (working copy) >@@ -196,6 +196,7 @@ > public TestElement createTestElement() { > model = makeProxyControl(); > log.debug("creating/configuring model = " + model); >+ model.setInGuiMode(true); > modifyTestElement(model); > return model; > } >@@ -220,6 +221,7 @@ > configureTestElement(el); > if (el instanceof ProxyControl) { > model = (ProxyControl) el; >+ model.setInGuiMode(true); > model.setPort(portField.getText()); > setIncludeListInProxyControl(model); > setExcludeListInProxyControl(model); >@@ -371,6 +373,7 @@ > modifyTestElement(model); > try { > replacer.replaceValues(model); >+ model.setInGuiMode(true); > model.startProxy(); > start.setEnabled(false); > stop.setEnabled(true);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 46436
: 23118 |
23175