You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by bv...@apache.org on 2013/01/22 07:31:37 UTC

svn commit: r1436760 - in /camel/branches/camel-2.10.x: ./ components/camel-jetty/src/test/java/org/apache/camel/component/jetty/jettyproducer/JettyHttpProducerSimulate404ErrorTest.java

Author: bvahdat
Date: Tue Jan 22 06:31:35 2013
New Revision: 1436760

URL: http://svn.apache.org/viewvc?rev=1436760&view=rev
Log:
Merged revisions 1436759 via svnmerge from 
https://svn.apache.org/repos/asf/camel/trunk

........
  r1436759 | bvahdat | 2013-01-22 07:29:25 +0100 (Di, 22 Jan 2013) | 1 line
  
  CAMEL-5983: Better make use of ProducerTemplate.sendBody() instead of ProducerTemplate.request() API so that effectively an exception is thrown and not only gets attached on the returned Exchange. This would better match to the original purpose of this test.
........

Modified:
    camel/branches/camel-2.10.x/   (props changed)
    camel/branches/camel-2.10.x/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/jettyproducer/JettyHttpProducerSimulate404ErrorTest.java

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

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

Modified: camel/branches/camel-2.10.x/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/jettyproducer/JettyHttpProducerSimulate404ErrorTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/jettyproducer/JettyHttpProducerSimulate404ErrorTest.java?rev=1436760&r1=1436759&r2=1436760&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/jettyproducer/JettyHttpProducerSimulate404ErrorTest.java (original)
+++ camel/branches/camel-2.10.x/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/jettyproducer/JettyHttpProducerSimulate404ErrorTest.java Tue Jan 22 06:31:35 2013
@@ -40,14 +40,16 @@ public class JettyHttpProducerSimulate40
         // give Jetty time to startup properly
         Thread.sleep(1000);
 
-        Exchange exchange = template.request(url, null);
-
-        assertNotNull(exchange.getException());
-        HttpOperationFailedException cause = assertIsInstanceOf(HttpOperationFailedException.class, exchange.getException());
-        assertEquals(404, cause.getStatusCode());
-        assertEquals("http//0.0.0.0:" + getPort() + "/bar", cause.getUri());
-        assertEquals("Page not found", cause.getResponseBody());
-        assertNotNull(cause.getResponseHeaders());
+        try {
+            template.sendBody(url, null);
+            fail("Should have thrown exception");
+        } catch (Exception e) {
+            HttpOperationFailedException cause = assertIsInstanceOf(HttpOperationFailedException.class, e.getCause());
+            assertEquals(404, cause.getStatusCode());
+            assertEquals("http//0.0.0.0:" + getPort() + "/bar", cause.getUri());
+            assertEquals("Page not found", cause.getResponseBody());
+            assertNotNull(cause.getResponseHeaders());
+        }
     }
 
     @Override