camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bvah...@apache.org
Subject svn commit: r1242857 - in /camel/trunk/components/camel-spring-ws/src/test: java/org/apache/camel/component/spring/ws/ProducerRemoteRouteTimeOutTest.java resources/org/apache/camel/component/spring/ws/ProducerRemoteRouteTimeOutTest-context.xml
Date Fri, 10 Feb 2012 17:02:29 GMT
Author: bvahdat
Date: Fri Feb 10 17:02:29 2012
New Revision: 1242857

URL: http://svn.apache.org/viewvc?rev=1242857&view=rev
Log:
CAMEL-4998: More asserts by ProducerRemoteRouteTimeOutTest.

Modified:
    camel/trunk/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/ProducerRemoteRouteTimeOutTest.java
    camel/trunk/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/ProducerRemoteRouteTimeOutTest-context.xml

Modified: camel/trunk/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/ProducerRemoteRouteTimeOutTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/ProducerRemoteRouteTimeOutTest.java?rev=1242857&r1=1242856&r2=1242857&view=diff
==============================================================================
--- camel/trunk/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/ProducerRemoteRouteTimeOutTest.java
(original)
+++ camel/trunk/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/ProducerRemoteRouteTimeOutTest.java
Fri Feb 10 17:02:29 2012
@@ -31,14 +31,17 @@ import org.apache.camel.Produce;
 import org.apache.camel.ProducerTemplate;
 import org.apache.camel.component.spring.ws.SpringWebserviceProducer.CamelHttpUrlConnectionMessageSender;
 import org.apache.camel.component.spring.ws.SpringWebserviceProducer.CamelHttpsUrlConnectionMessageSender;
+
 import org.junit.Ignore;
 import org.junit.Test;
+
 import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
 import org.springframework.ws.transport.http.HttpUrlConnectionMessageSender;
 import org.springframework.ws.transport.http.HttpsUrlConnectionMessageSender;
 
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
@@ -65,7 +68,12 @@ public class ProducerRemoteRouteTimeOutT
     @Ignore("Run manually, makes connection to external webservice")
     @Test
     public void callStockQuoteWebserviceCommonsHttpWith5000MillSecondsTimeout() throws Exception
{
-        template.requestBody("direct:stockQuoteWebserviceCommonsHttpWith5000MillSecondsTimeout",
xmlRequestForGoogleStockQuote);
+        Object result = template.requestBody("direct:stockQuoteWebserviceCommonsHttpWith5000MillSecondsTimeout",
xmlRequestForGoogleStockQuote);
+        
+        assertNotNull(result);
+        assertTrue(result instanceof String);
+        String resultMessage = (String) result;
+        assertTrue(resultMessage.contains("Google Inc."));
     }
 
     @Ignore("Run manually, makes connection to external webservice")
@@ -82,7 +90,12 @@ public class ProducerRemoteRouteTimeOutT
     @Ignore("Run manually, makes connection to external webservice")
     @Test
     public void callStockQuoteWebserviceJDKWith5000MillSecondsTimeout() throws Exception
{
-        template.requestBody("direct:stockQuoteWebserviceJDKWith5000MillSecondsTimeout",
xmlRequestForGoogleStockQuote);
+        Object result = template.requestBody("direct:stockQuoteWebserviceJDKWith5000MillSecondsTimeout",
xmlRequestForGoogleStockQuote);
+
+        assertNotNull(result);
+        assertTrue(result instanceof String);
+        String resultMessage = (String) result;
+        assertTrue(resultMessage.contains("Google Inc."));
     }
 
     private static boolean hasThrowableInChain(Throwable throwable, Class<? extends Throwable>
clazz) {

Modified: camel/trunk/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/ProducerRemoteRouteTimeOutTest-context.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/ProducerRemoteRouteTimeOutTest-context.xml?rev=1242857&r1=1242856&r2=1242857&view=diff
==============================================================================
--- camel/trunk/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/ProducerRemoteRouteTimeOutTest-context.xml
(original)
+++ camel/trunk/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/ProducerRemoteRouteTimeOutTest-context.xml
Fri Feb 10 17:02:29 2012
@@ -39,21 +39,25 @@
 		<route>
 			<from uri="direct:stockQuoteWebserviceCommonsHttpWith3MillSecondsTimeout" />
 			<to uri="spring-ws:http://www.webservicex.net/stockquote.asmx?timeout=3&amp;webServiceTemplate=#commonsHttpWebServiceTemplate&amp;soapAction=http://www.webserviceX.NET/GetQuote"
/>
+			<convertBodyTo type="java.lang.String"/>
 		</route>
 
 		<route>
 			<from uri="direct:stockQuoteWebserviceCommonsHttpWith5000MillSecondsTimeout" />
 			<to uri="spring-ws:http://www.webservicex.net/stockquote.asmx?timeout=5000&amp;webServiceTemplate=#commonsHttpWebServiceTemplate&amp;soapAction=http://www.webserviceX.NET/GetQuote"
/>
+			<convertBodyTo type="java.lang.String"/>
 		</route>
 
 		<route>
 			<from uri="direct:stockQuoteWebserviceJDKWith3MillSecondsTimeout" />
 			<to uri="spring-ws:http://www.webservicex.net/stockquote.asmx?timeout=3&amp;webServiceTemplate=#jdkHttpWebServiceTemplate&amp;soapAction=http://www.webserviceX.NET/GetQuote"
/>
+			<convertBodyTo type="java.lang.String"/>
 		</route>
 
 		<route>
 			<from uri="direct:stockQuoteWebserviceJDKWith5000MillSecondsTimeout" />
 			<to uri="spring-ws:http://www.webservicex.net/stockquote.asmx?timeout=5000&amp;webServiceTemplate=#jdkHttpWebServiceTemplate&amp;soapAction=http://www.webserviceX.NET/GetQuote"
/>
+			<convertBodyTo type="java.lang.String"/>
 		</route>
 	</camelContext>
 



Mime
View raw message