camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r936879 - in /camel/trunk/components/camel-http/src/test/java/org/apache/camel/component/http: HttpQueryGoogleProxyTest.java HttpQueryGoogleTest.java
Date Thu, 22 Apr 2010 14:49:02 GMT
Author: davsclaus
Date: Thu Apr 22 14:49:02 2010
New Revision: 936879

URL: http://svn.apache.org/viewvc?rev=936879&view=rev
Log:
Added test for proxy auth

Added:
    camel/trunk/components/camel-http/src/test/java/org/apache/camel/component/http/HttpQueryGoogleProxyTest.java
  (with props)
Modified:
    camel/trunk/components/camel-http/src/test/java/org/apache/camel/component/http/HttpQueryGoogleTest.java

Added: camel/trunk/components/camel-http/src/test/java/org/apache/camel/component/http/HttpQueryGoogleProxyTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-http/src/test/java/org/apache/camel/component/http/HttpQueryGoogleProxyTest.java?rev=936879&view=auto
==============================================================================
--- camel/trunk/components/camel-http/src/test/java/org/apache/camel/component/http/HttpQueryGoogleProxyTest.java
(added)
+++ camel/trunk/components/camel-http/src/test/java/org/apache/camel/component/http/HttpQueryGoogleProxyTest.java
Thu Apr 22 14:49:02 2010
@@ -0,0 +1,52 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.http;
+
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * @version $Revision$
+ */
+public class HttpQueryGoogleProxyTest extends CamelTestSupport {
+
+    public boolean isUseRouteBuilder() {
+        return false;
+    }
+
+    @Test
+    @Ignore("Run manually")
+    public void testQueryGoogleProxy() throws Exception {
+        HttpConfiguration config = new HttpConfiguration();
+        config.setProxyHost("aa");
+        config.setProxyPort(80);
+        config.setProxyAuthMethod(AuthMethod.Basic);
+        config.setAuthMethodPriority("Basic,Digest");
+        config.setProxyAuthUsername("aa");
+        config.setProxyAuthPassword("aa");
+
+        HttpComponent http = context.getComponent("http", HttpComponent.class);
+        http.setHttpConfiguration(config);
+
+        Object out = template.requestBody("http://google.com/search?q=Camel", "");
+        assertNotNull(out);
+        String data = context.getTypeConverter().convertTo(String.class, out);
+        assertTrue("Camel should be in search result from Google", data.indexOf("Camel")
> -1);
+    }
+
+}

Propchange: camel/trunk/components/camel-http/src/test/java/org/apache/camel/component/http/HttpQueryGoogleProxyTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-http/src/test/java/org/apache/camel/component/http/HttpQueryGoogleProxyTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: camel/trunk/components/camel-http/src/test/java/org/apache/camel/component/http/HttpQueryGoogleTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-http/src/test/java/org/apache/camel/component/http/HttpQueryGoogleTest.java?rev=936879&r1=936878&r2=936879&view=diff
==============================================================================
--- camel/trunk/components/camel-http/src/test/java/org/apache/camel/component/http/HttpQueryGoogleTest.java
(original)
+++ camel/trunk/components/camel-http/src/test/java/org/apache/camel/component/http/HttpQueryGoogleTest.java
Thu Apr 22 14:49:02 2010
@@ -20,7 +20,6 @@ import org.apache.camel.test.junit4.Came
 import org.junit.Ignore;
 import org.junit.Test;
 
-
 /**
  * Unit test to query Google using GET with endpoint having the query parameters.
  */
@@ -31,7 +30,7 @@ public class HttpQueryGoogleTest extends
     }
 
     @Test
-    @Ignore("ignore online tests, will be improved in Camel 2.3")
+    @Ignore("Run manually")
     public void testQueryGoogle() throws Exception {
         Object out = template.requestBody("http://www.google.com/search?q=Camel", "");
         assertNotNull(out);



Mime
View raw message