You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2012/09/12 11:10:52 UTC

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

Author: ningjiang
Date: Wed Sep 12 09:10:52 2012
New Revision: 1383859

URL: http://svn.apache.org/viewvc?rev=1383859&view=rev
Log:
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.10.x/   (props changed)
    camel/branches/camel-2.10.x/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpProxyServerTest.java

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

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

Modified: camel/branches/camel-2.10.x/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpProxyServerTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpProxyServerTest.java?rev=1383859&r1=1383858&r2=1383859&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpProxyServerTest.java (original)
+++ camel/branches/camel-2.10.x/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpProxyServerTest.java Wed Sep 12 09:10:52 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 {