Author: ningjiang
Date: Fri Jun 5 01:54:13 2009
New Revision: 781885
URL: http://svn.apache.org/viewvc?rev=781885&view=rev
Log:
Merged revisions 781775 via svnmerge from
https://svn.apache.org/repos/asf/camel/trunk
........
r781775 | davsclaus | 2009-06-04 23:23:51 +0800 (Thu, 04 Jun 2009) | 1 line
Added unit test for SOTimeout for http client based on user forum.
........
Added:
camel/branches/camel-1.x/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpProducerSOTimeoutTest.java
- copied, changed from r781775,
camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpProducerSOTimeoutTest.java
Modified:
camel/branches/camel-1.x/ (props changed)
Propchange: camel/branches/camel-1.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jun 5 01:54:13 2009
@@ -1 +1 @@
-/camel/trunk:736980,739733,739904,740251,740295,740306,740596,740663,741848,742231,742705,742739,742854,742856,742898,742906,743613,743762,743773,743920,743959-743960,744123,745105,745367,745541,745751,745826,745978,746269,746872,746895,746962,747258,747678-747704,748392,748436,748821,749563-749564,749574,749628-749629,749936,749956,750017,750334,750396,750761,750796,752068,752117,752418,752751-752755,752764-752773,752956,753087,753101,753175,755136,755487,756313,756348,756870,756939,757636,757693,757743,757865,758539,758563,758600,758617,758692,758990,759362,759453,759887,759931,760003,760890,760909,760937,761194,761536,761583,761607,762047,762633,762650,762935,763095,763484,763551,765154,765686,765729,765743,765824,766016,766289,766584,766588,766590,766602,766673,767403,767824,768342,769239,769346,769368,769434,770172,770906,771303,773193,773446,773781,774192,774383,774658-774659,776198,776289,776504,776975,778102,778689-778701,779121,779143,779489
+/camel/trunk:736980,739733,739904,740251,740295,740306,740596,740663,741848,742231,742705,742739,742854,742856,742898,742906,743613,743762,743773,743920,743959-743960,744123,745105,745367,745541,745751,745826,745978,746269,746872,746895,746962,747258,747678-747704,748392,748436,748821,749563-749564,749574,749628-749629,749936,749956,750017,750334,750396,750761,750796,752068,752117,752418,752751-752755,752764-752773,752956,753087,753101,753175,755136,755487,756313,756348,756870,756939,757636,757693,757743,757865,758539,758563,758600,758617,758692,758990,759362,759453,759887,759931,760003,760890,760909,760937,761194,761536,761583,761607,762047,762633,762650,762935,763095,763484,763551,765154,765686,765729,765743,765824,766016,766289,766584,766588,766590,766602,766673,767403,767824,768342,769239,769346,769368,769434,770172,770906,771303,773193,773446,773781,774192,774383,774658-774659,776198,776289,776504,776975,778102,778689-778701,779121,779143,779489,781775
Propchange: camel/branches/camel-1.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Copied:
camel/branches/camel-1.x/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpProducerSOTimeoutTest.java
(from r781775,
camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpProducerSOTimeoutTest.java)
URL:
http://svn.apache.org/viewvc/camel/branches/camel-1.x/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpProducerSOTimeoutTest.java?p2=camel/branches/camel-1.x/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpProducerSOTimeoutTest.java&p1=camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpProducerSOTimeoutTest.java&r1=781775&r2=781885&rev=781885&view=diff
==============================================================================
---
camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpProducerSOTimeoutTest.java
(original)
+++
camel/branches/camel-1.x/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpProducerSOTimeoutTest.java
Fri Jun 5 01:54:13 2009
@@ -16,6 +16,7 @@
*/
package org.apache.camel.component.jetty;
+import java.io.InputStream;
import java.net.SocketTimeoutException;
import org.apache.camel.ContextTestSupport;
@@ -34,8 +35,8 @@
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedMessageCount(1);
- String out =
template.requestBody("http://localhost:9080/myservice?httpClient.soTimeout=5000",
null, String.class);
- assertEquals("Bye World", out);
+ InputStream out = (InputStream)
template.requestBody("http://localhost:9080/myservice?httpClient.soTimeout=5000",
null);
+ assertEquals("Bye World",
context.getTypeConverter().convertTo(String.class, out));
assertMockEndpointsSatisfied();
}
@@ -46,7 +47,7 @@
try {
// we use a timeout of 1 second
-
template.requestBody("http://localhost:9080/myservice?httpClient.soTimeout=1000",
null, String.class);
+
template.requestBody("http://localhost:9080/myservice?httpClient.soTimeout=1000",
null);
fail("Should throw an exception");
} catch (RuntimeCamelException e) {
assertIsInstanceOf(SocketTimeoutException.class, e.getCause());
@@ -62,7 +63,7 @@
public void configure() throws Exception {
from("jetty://http://0.0.0.0:9080/myservice")
// but we wait for 2 sec before reply is sent back
- .delay(2000)
+ .delayer(2000)
.transform().constant("Bye World").to("mock:result");
}
};