Author: bvahdat
Date: Mon Jan 21 21:10:46 2013
New Revision: 1436621

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

........
  r1436619 | bvahdat | 2013-01-21 22:09:01 +0100 (Mo, 21 Jan 2013) | 1 line
  
  CAMEL-5983: the intention should be correctly to make use of the 
"direct:requiredAndNewRollback" endpoint by the last test to show that the 
first transaction will commit and the second one will rollback as the book name 
contains "Donkey". This's now properly corrected.
........

Modified:
    camel/branches/camel-2.10.x/   (props changed)
    
camel/branches/camel-2.10.x/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/MixedPropagationTransactedTest.java

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

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

Modified: 
camel/branches/camel-2.10.x/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/MixedPropagationTransactedTest.java
URL: 
http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/MixedPropagationTransactedTest.java?rev=1436621&r1=1436620&r2=1436621&view=diff
==============================================================================
--- 
camel/branches/camel-2.10.x/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/MixedPropagationTransactedTest.java
 (original)
+++ 
camel/branches/camel-2.10.x/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/MixedPropagationTransactedTest.java
 Mon Jan 21 21:10:46 2013
@@ -113,13 +113,21 @@ public class MixedPropagationTransactedT
         assertEquals("Number of books", 1, count);
     }
 
-    public void testRequiredAndNew() throws Exception {
-        template.sendBody("direct:requiredAndNew", "Tiger in Action");
+    public void testRequiredAndNewRollback() throws Exception {
+        try {
+            template.sendBody("direct:requiredAndNewRollback", "Tiger in 
Action");
+        } catch (RuntimeCamelException e) {
+            // expeced as we fail
+            assertIsInstanceOf(RuntimeCamelException.class, e.getCause());
+            assertTrue(e.getCause().getCause() instanceof 
IllegalArgumentException);
+            assertEquals("We don't have Donkeys, only Camels", 
e.getCause().getCause().getMessage());
+        }
 
         int count = jdbc.queryForInt("select count(*) from books");
-        assertEquals(2, jdbc.queryForInt("select count(*) from books where 
title = ?", "Tiger in Action"));
+        assertEquals(1, jdbc.queryForInt("select count(*) from books where 
title = ?", "Tiger in Action"));
         assertEquals(0, jdbc.queryForInt("select count(*) from books where 
title = ?", "Donkey in Action"));
-        assertEquals("Number of books", 3, count);
+        // the tiger in action should be committed, but our 2nd route should 
rollback
+        assertEquals("Number of books", 2, count);
     }
 
     protected RouteBuilder createRouteBuilder() throws Exception {


Reply via email to