camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bvah...@apache.org
Subject svn commit: r1436490 - in /camel/branches/camel-2.10.x: ./ camel-core/src/test/java/org/apache/camel/issues/CacheInputStreamInDeadLetterIssue520Test.java camel-core/src/test/java/org/apache/camel/processor/ValidationTest.java
Date Mon, 21 Jan 2013 17:10:36 GMT
Author: bvahdat
Date: Mon Jan 21 17:10:36 2013
New Revision: 1436490

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

........
  r1436487 | bvahdat | 2013-01-21 18:02:22 +0100 (Mo, 21 Jan 2013) | 1 line
  
  CAMEL-5983: Avoid the negative-tests to behave as false-positive. Work still in progress.
........

Modified:
    camel/branches/camel-2.10.x/   (props changed)
    camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/issues/CacheInputStreamInDeadLetterIssue520Test.java
    camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/processor/ValidationTest.java

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

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

Modified: camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/issues/CacheInputStreamInDeadLetterIssue520Test.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/issues/CacheInputStreamInDeadLetterIssue520Test.java?rev=1436490&r1=1436489&r2=1436490&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/issues/CacheInputStreamInDeadLetterIssue520Test.java
(original)
+++ camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/issues/CacheInputStreamInDeadLetterIssue520Test.java
Mon Jan 21 17:10:36 2013
@@ -25,7 +25,6 @@ import javax.xml.transform.stream.Stream
 import org.apache.camel.ContextTestSupport;
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
-import org.apache.camel.RuntimeCamelException;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 
@@ -52,13 +51,10 @@ public class CacheInputStreamInDeadLette
         MockEndpoint mock = getMockEndpoint("mock:error");
         mock.expectedMessageCount(1);
 
-        try {
-            template.sendBody("direct:start", message);
-        } catch (RuntimeCamelException e) {
-            assertTrue(e.getCause() instanceof Exception);
-            assertEquals("Forced exception by unit test", e.getCause().getMessage());
-        }
-        
+        // having dead letter channel as the errorHandler in place makes exchanges to appear
as completed from
+        // the client point of view so that we don't count with any thrown exception here
(the client side)
+        template.sendBody("direct:start", message);
+
         assertEquals("The message should be delivered 4 times", count, 4);
         mock.assertIsSatisfied();
     }

Modified: camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/processor/ValidationTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/processor/ValidationTest.java?rev=1436490&r1=1436489&r2=1436490&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/processor/ValidationTest.java
(original)
+++ camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/processor/ValidationTest.java
Mon Jan 21 17:10:36 2013
@@ -38,19 +38,22 @@ public class ValidationTest extends Cont
         invalidEndpoint.expectedMessageCount(0);
 
         Object result = template.requestBodyAndHeader("direct:start", "<valid/>", "foo",
"bar");
+        assertEquals("validResult", result);
 
         assertMockEndpointsSatisfied();
-        assertEquals("validResult", result);
     }
 
     public void testInvalidMessage() throws Exception {
-        invalidEndpoint.expectedMessageCount(1);
         validEndpoint.expectedMessageCount(0);
+        invalidEndpoint.expectedMessageCount(1);
 
         try {
             template.sendBodyAndHeader("direct:start", "<invalid/>", "foo", "notMatchedHeaderValue");
         } catch (RuntimeCamelException e) {
-            // expected
+            // the expected empty catch block here is not intended for this class itself
but the drived
+            // ones e.g. ValidationWithErrorInHandleAndFinallyBlockTest where noErrorHandler()
is being
+            // installed. this's also why there's no fail("Should have thrown an exception")
call here
+            // right after template.sendBodyAndHeader()
         }
 
         assertMockEndpointsSatisfied();
@@ -63,7 +66,7 @@ public class ValidationTest extends Cont
         try {
             template.sendBodyAndHeader("direct:start", "<invalid/>", "foo",  "notMatchedHeaderValue");
         } catch (RuntimeCamelException e) {
-            // expected
+            // the same as above
         }
 
         Object result = template.requestBodyAndHeader("direct:start", "<valid/>", "foo",
  "bar");



Mime
View raw message