Quantcast

svn commit: r1383863 - in /camel/branches/camel-2.9.x: ./ components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpProxyServerTest.java

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

svn commit: r1383863 - in /camel/branches/camel-2.9.x: ./ components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpProxyServerTest.java

ningjiang
Author: ningjiang
Date: Wed Sep 12 09:21:04 2012
New Revision: 1383863

URL: http://svn.apache.org/viewvc?rev=1383863&view=rev
Log:
Merged revisions 1383859 via svnmerge from
https://svn.apache.org/repos/asf/camel/branches/camel-2.10.x

................
  r1383859 | ningjiang | 2012-09-12 17:10:52 +0800 (Wed, 12 Sep 2012) | 9 lines
 
  Merged revisions 1383858 via svnmerge from
  https://svn.apache.org/repos/asf/camel/trunk
 
  ........
    r1383858 | ningjiang | 2012-09-12 16:58:58 +0800 (Wed, 12 Sep 2012) | 1 line
   
    CAMEL-5595 added unit test for it
  ........
................

Modified:
    camel/branches/camel-2.9.x/   (props changed)
    camel/branches/camel-2.9.x/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpProxyServerTest.java

Propchange: camel/branches/camel-2.9.x/
------------------------------------------------------------------------------
  Merged /camel/trunk:r1383858
  Merged /camel/branches/camel-2.10.x:r1383859

Propchange: camel/branches/camel-2.9.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-2.9.x/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpProxyServerTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpProxyServerTest.java?rev=1383863&r1=1383862&r2=1383863&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpProxyServerTest.java (original)
+++ camel/branches/camel-2.9.x/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpProxyServerTest.java Wed Sep 12 09:21:04 2012
@@ -105,6 +105,26 @@ public class HttpProxyServerTest extends
 
         assertEquals("Should get the same EndpointKey", http1.getEndpointKey(), http2.getEndpointKey());
     }
+    
+    @Test
+    public void testhttpGetProxyScheme() throws Exception {
+        context.getProperties().put("http.proxyHost", "myProxy");
+        context.getProperties().put("http.proxyPort", "1234");
+        context.getProperties().put("http.proxyScheme", "http");
+        try {
+            HttpEndpoint http1 = context.getEndpoint("https4://www.google.com", HttpEndpoint.class);
+            
+            HttpClient client1 = http1.createHttpClient();
+            HttpHost proxy1 = (HttpHost)client1.getParams().getParameter(ConnRoutePNames.DEFAULT_PROXY);
+            assertEquals("myProxy", proxy1.getHostName());
+            assertEquals(1234, proxy1.getPort());
+            assertEquals("http", proxy1.getSchemeName());
+        } finally {
+            context.getProperties().remove("http.proxyHost");
+            context.getProperties().remove("http.proxyPort");
+            context.getProperties().remove("http.proxyScheme");
+        }
+    }
 
     @Test
     public void httpGetWithProxyAndWithoutUser() throws Exception {


Loading...