You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2009/06/05 13:34:43 UTC

svn commit: r781988 - in /camel/branches/camel-1.x: ./ components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/ components/camel-spring/src/test/resources/org/apache/camel/spring/interceptor/

Author: davsclaus
Date: Fri Jun  5 11:34:42 2009
New Revision: 781988

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

........
  r781974 | davsclaus | 2009-06-05 12:17:52 +0200 (Fri, 05 Jun 2009) | 1 line
  
  CAMEL-1663: Added unit test with a POJO using mixed annotations from Spring and Camel. And based on idea from CAMEL-1601.
........

Added:
    camel/branches/camel-1.x/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/AnnotatedBookServiceImpl.java
      - copied unchanged from r781974, camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/AnnotatedBookServiceImpl.java
    camel/branches/camel-1.x/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/AnnotatedBookStore.java
      - copied unchanged from r781974, camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/AnnotatedBookStore.java
    camel/branches/camel-1.x/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/AnnotatedRoute.java
      - copied, changed from r781974, camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/AnnotatedRoute.java
    camel/branches/camel-1.x/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/TransactionClientWithAnnotatedBeanTest.java
      - copied unchanged from r781974, camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/TransactionClientWithAnnotatedBeanTest.java
    camel/branches/camel-1.x/components/camel-spring/src/test/resources/org/apache/camel/spring/interceptor/transactionClientWithAnnotatedBeanTest.xml
      - copied, changed from r781974, camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/interceptor/transactionClientWithAnnotatedBeanTest.xml
Modified:
    camel/branches/camel-1.x/   (props changed)

Propchange: camel/branches/camel-1.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jun  5 11:34:42 2009
@@ -1 +1 @@
-/camel/trunk:736980,739733,739904,740251,740295,740306,740596,740663,741848,742231,742705,742739,742854,742856,742898,742906,743613,743762,743773,743920,743959-743960,744123,745105,745367,745541,745751,745826,745978,746269,746872,746895,746962,747258,747678-747704,748392,748436,748821,749563-749564,749574,749628-749629,749936,749956,750017,750334,750396,750761,750796,752068,752117,752418,752751-752755,752764-752773,752956,753087,753101,753175,755136,755487,756313,756348,756870,756939,757636,757693,757743,757865,758539,758563,758600,758617,758692,758990,759362,759453,759887,759931,760003,760890,760909,760937,761194,761536,761583,761607,762047,762633,762650,762935,763095,763484,763551,765154,765686,765729,765743,765824,766016,766289,766584,766588,766590,766602,766673,767403,767824,768342,769239,769346,769368,769434,770172,770906,771303,773193,773446,773781,774192,774383,774658-774659,776198,776289,776504,776975,778102,778689-778701,779121,779143,779489,781775,781923
+/camel/trunk:736980,739733,739904,740251,740295,740306,740596,740663,741848,742231,742705,742739,742854,742856,742898,742906,743613,743762,743773,743920,743959-743960,744123,745105,745367,745541,745751,745826,745978,746269,746872,746895,746962,747258,747678-747704,748392,748436,748821,749563-749564,749574,749628-749629,749936,749956,750017,750334,750396,750761,750796,752068,752117,752418,752751-752755,752764-752773,752956,753087,753101,753175,755136,755487,756313,756348,756870,756939,757636,757693,757743,757865,758539,758563,758600,758617,758692,758990,759362,759453,759887,759931,760003,760890,760909,760937,761194,761536,761583,761607,762047,762633,762650,762935,763095,763484,763551,765154,765686,765729,765743,765824,766016,766289,766584,766588,766590,766602,766673,767403,767824,768342,769239,769346,769368,769434,770172,770906,771303,773193,773446,773781,774192,774383,774658-774659,776198,776289,776504,776975,778102,778689-778701,779121,779143,779489,781775,781923,781974

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

Copied: camel/branches/camel-1.x/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/AnnotatedRoute.java (from r781974, camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/AnnotatedRoute.java)
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/AnnotatedRoute.java?p2=camel/branches/camel-1.x/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/AnnotatedRoute.java&p1=camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/AnnotatedRoute.java&r1=781974&r2=781988&rev=781988&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/AnnotatedRoute.java (original)
+++ camel/branches/camel-1.x/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/AnnotatedRoute.java Fri Jun  5 11:34:42 2009
@@ -17,6 +17,7 @@
 package org.apache.camel.spring.interceptor;
 
 import org.apache.camel.spring.SpringRouteBuilder;
+import org.apache.camel.spring.spi.SpringTransactionPolicy;
 
 /**
  * @version $Revision$
@@ -24,13 +25,16 @@
 public class AnnotatedRoute extends SpringRouteBuilder {
 
     public void configure() throws Exception {
+        SpringTransactionPolicy required = getContext().getRegistry()
+            .lookup("PROPAGATION_REQUIRED", SpringTransactionPolicy.class);
+
         from("direct:okay").
-                transacted().
+                policy(required).
                 setBody(constant("Tiger in Action")).beanRef("bookService").
                 setBody(constant("Elephant in Action")).beanRef("bookService");
 
         from("direct:fail").
-                transacted().
+                policy(required).
                 setBody(constant("Tiger in Action")).beanRef("bookService").
                 setBody(constant("Donkey in Action")).beanRef("bookService");
     }

Copied: camel/branches/camel-1.x/components/camel-spring/src/test/resources/org/apache/camel/spring/interceptor/transactionClientWithAnnotatedBeanTest.xml (from r781974, camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/interceptor/transactionClientWithAnnotatedBeanTest.xml)
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/components/camel-spring/src/test/resources/org/apache/camel/spring/interceptor/transactionClientWithAnnotatedBeanTest.xml?p2=camel/branches/camel-1.x/components/camel-spring/src/test/resources/org/apache/camel/spring/interceptor/transactionClientWithAnnotatedBeanTest.xml&p1=camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/interceptor/transactionClientWithAnnotatedBeanTest.xml&r1=781974&r2=781988&rev=781988&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/interceptor/transactionClientWithAnnotatedBeanTest.xml (original)
+++ camel/branches/camel-1.x/components/camel-spring/src/test/resources/org/apache/camel/spring/interceptor/transactionClientWithAnnotatedBeanTest.xml Fri Jun  5 11:34:42 2009
@@ -19,7 +19,7 @@
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
        xmlns:context="http://www.springframework.org/schema/context"
        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
-         http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
+         http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
 
     <context:component-scan base-package="org.apache.camel.spring.interceptor"/>
     <tx:annotation-driven transaction-manager="txManager"/>
@@ -37,11 +37,16 @@
         <property name="dataSource" ref="dataSource"/>
     </bean>
 
+    <!-- policy for required transaction used in our Camel routes -->
+    <bean id="PROPAGATION_REQUIRED" class="org.apache.camel.spring.spi.SpringTransactionPolicy">
+        <property name="transactionManager" ref="txManager"/>
+    </bean>
+
     <!-- bean for book business logic -->
     <bean id="bookService" class="org.apache.camel.spring.interceptor.AnnotatedBookServiceImpl"/>
 
-    <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
-        <routeBuilder ref="annotatedRoute"/>
+    <camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
+        <routeBuilderRef ref="annotatedRoute"/>
     </camelContext>
 
     <bean id="annotatedRoute" class="org.apache.camel.spring.interceptor.AnnotatedRoute"/>