camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bvah...@apache.org
Subject svn commit: r1436422 - in /camel/branches/camel-2.10.x: ./ camel-core/src/test/java/org/apache/camel/issues/ExceptionTest.java camel-core/src/test/java/org/apache/camel/language/BeanTest.java
Date Mon, 21 Jan 2013 15:37:11 GMT
Author: bvahdat
Date: Mon Jan 21 15:37:10 2013
New Revision: 1436422

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

........
  r1436420 | bvahdat | 2013-01-21 16:34:56 +0100 (Mo, 21 Jan 2013) | 1 line
  
  CAMEL-5983: Avoid the negative-tests to behave as false-positive.
........

Modified:
    camel/branches/camel-2.10.x/   (props changed)
    camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/issues/ExceptionTest.java
    camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/language/BeanTest.java

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

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/ExceptionTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/issues/ExceptionTest.java?rev=1436422&r1=1436421&r2=1436422&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/issues/ExceptionTest.java
(original)
+++ camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/issues/ExceptionTest.java
Mon Jan 21 15:37:10 2013
@@ -32,14 +32,14 @@ public class ExceptionTest extends Conte
         MockEndpoint resultEndpoint = getMockEndpoint("mock:result");
         MockEndpoint exceptionEndpoint = getMockEndpoint("mock:exception");
 
-        errorEndpoint.expectedMessageCount(1);
-        resultEndpoint.expectedMessageCount(0);
+        errorEndpoint.expectedBodiesReceived("<exception/>");
         exceptionEndpoint.expectedMessageCount(0);
+        resultEndpoint.expectedMessageCount(0);
 
         // we don't expect any thrown exception here as there's no onException clause defined
for this test
-        // so that the general purpose dead letter channel will come into the play here and
then when all
-        // the attempts of redelivery fail the exchange will be moved to "mock:error" and
then from the client
-        // point of view the exchange is completed.
+        // so that the general purpose dead letter channel will come into the play and then
when all the attempts
+        // to redelivery fails the exchange will be moved to "mock:error" and then from the
client point of
+        // view the exchange is completed.
         template.sendBody("direct:start", "<body/>");
 
         assertMockEndpointsSatisfied();
@@ -51,7 +51,7 @@ public class ExceptionTest extends Conte
         MockEndpoint exceptionEndpoint = getMockEndpoint("mock:exception");
 
         errorEndpoint.expectedMessageCount(0);
-        exceptionEndpoint.expectedMessageCount(1);
+        exceptionEndpoint.expectedBodiesReceived("<exception/>");
         resultEndpoint.expectedMessageCount(0);
 
         try {
@@ -70,7 +70,7 @@ public class ExceptionTest extends Conte
         MockEndpoint exceptionEndpoint = getMockEndpoint("mock:exception");
 
         errorEndpoint.expectedMessageCount(0);
-        exceptionEndpoint.expectedBodiesReceived("<handled/>");
+        exceptionEndpoint.expectedBodiesReceived("<not-handled/>");
         resultEndpoint.expectedMessageCount(0);
 
         try {
@@ -89,7 +89,7 @@ public class ExceptionTest extends Conte
         MockEndpoint exceptionEndpoint = getMockEndpoint("mock:exception");
 
         errorEndpoint.expectedMessageCount(0);
-        exceptionEndpoint.expectedMessageCount(1);
+        exceptionEndpoint.expectedBodiesReceived("<exception/>");
         resultEndpoint.expectedMessageCount(0);
 
         try {
@@ -117,7 +117,7 @@ public class ExceptionTest extends Conte
 
                 if (getName().endsWith("WithLongHandler")) {
                     log.debug("Using long exception handler");
-                    onException(IllegalArgumentException.class).setBody(constant("<handled/>")).
+                    onException(IllegalArgumentException.class).setBody(constant("<not-handled/>")).
                         to("mock:exception");
                 } else if (getName().endsWith("WithHandler")) {
                     log.debug("Using exception handler");

Modified: camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/language/BeanTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/language/BeanTest.java?rev=1436422&r1=1436421&r2=1436422&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/language/BeanTest.java
(original)
+++ camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/language/BeanTest.java
Mon Jan 21 15:37:10 2013
@@ -71,7 +71,8 @@ public class BeanTest extends LanguageTe
         Expression exp = BeanLanguage.bean(user, "unknown");
         Exchange exchange = createExchangeWithBody("Claus");
 
-        exp.evaluate(exchange, Object.class);
+        Object result = exp.evaluate(exchange, Object.class);
+        assertNull(result);
         MethodNotFoundException e = assertIsInstanceOf(MethodNotFoundException.class, exchange.getException());
         assertSame(user, e.getBean());
         assertEquals("unknown", e.getMethodName());
@@ -81,7 +82,8 @@ public class BeanTest extends LanguageTe
         Expression exp = BeanLanguage.bean("foo.cake");
         Exchange exchange = createExchangeWithBody("Claus");
 
-        exp.evaluate(exchange, Object.class);
+        Object result = exp.evaluate(exchange, Object.class);
+        assertNull(result);
         MethodNotFoundException e = assertIsInstanceOf(MethodNotFoundException.class, exchange.getException());
         assertSame(context.getRegistry().lookup("foo"), e.getBean());
         assertEquals("cake", e.getMethodName());



Mime
View raw message