You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by se...@apache.org on 2006/06/02 01:08:40 UTC

svn commit: r410988 - /jakarta/jmeter/branches/rel-2-1/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java

Author: sebb
Date: Thu Jun  1 16:08:39 2006
New Revision: 410988

URL: http://svn.apache.org/viewvc?rev=410988&view=rev
Log:
Add getDefaultPort() utility method

Modified:
    jakarta/jmeter/branches/rel-2-1/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java

Modified: jakarta/jmeter/branches/rel-2-1/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/branches/rel-2-1/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java?rev=410988&r1=410987&r2=410988&view=diff
==============================================================================
--- jakarta/jmeter/branches/rel-2-1/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java (original)
+++ jakarta/jmeter/branches/rel-2-1/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java Thu Jun  1 16:08:39 2006
@@ -355,6 +355,16 @@
 		setProperty(new IntegerProperty(PORT, value));
 	}
 
+    public static int getDefaultPort(String protocol,int port){
+        if (port==-1){
+            return 
+                protocol.equalsIgnoreCase(PROTOCOL_HTTP)  ? DEFAULT_HTTP_PORT :
+                protocol.equalsIgnoreCase(PROTOCOL_HTTPS) ? DEFAULT_HTTPS_PORT :
+                    port;
+        }
+        return port;
+    }
+    
 	public int getPort() {
 		int port = getPropertyAsInt(PORT);
 		if (port == UNSPECIFIED_PORT) {



---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org