camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r832470 - in /camel/trunk/components/camel-jms/src/test: java/org/apache/camel/component/jms/issues/JmsSpringSimpleTXResequencerTest.java resources/org/apache/camel/component/jms/issues/JmsSpringSimpleTXResequencerTest.xml
Date Tue, 03 Nov 2009 16:32:06 GMT
Author: davsclaus
Date: Tue Nov  3 16:32:06 2009
New Revision: 832470

URL: http://svn.apache.org/viewvc?rev=832470&view=rev
Log:
Added unit test for forum user issue

Added:
    camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsSpringSimpleTXResequencerTest.java
  (contents, props changed)
      - copied, changed from r832403, camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsSpringResequencerTest.java
    camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/issues/JmsSpringSimpleTXResequencerTest.xml
  (contents, props changed)
      - copied, changed from r832403, camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/issues/JmsSpringResequencerTest-context.xml

Copied: camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsSpringSimpleTXResequencerTest.java
(from r832403, camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsSpringResequencerTest.java)
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsSpringSimpleTXResequencerTest.java?p2=camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsSpringSimpleTXResequencerTest.java&p1=camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsSpringResequencerTest.java&r1=832403&r2=832470&rev=832470&view=diff
==============================================================================
--- camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsSpringResequencerTest.java
(original)
+++ camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsSpringSimpleTXResequencerTest.java
Tue Nov  3 16:32:06 2009
@@ -17,9 +17,31 @@
 
 package org.apache.camel.component.jms.issues;
 
-import org.springframework.test.context.ContextConfiguration;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit4.CamelSpringTestSupport;
+import org.junit.Test;
+import org.springframework.context.support.AbstractXmlApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
 
-@ContextConfiguration(inheritLocations = false)
-public class JmsSpringResequencerTest extends JmsResequencerTest {
+public class JmsSpringSimpleTXResequencerTest extends CamelSpringTestSupport {
 
-}
+    @Override
+    protected AbstractXmlApplicationContext createApplicationContext() {
+        return new ClassPathXmlApplicationContext("org/apache/camel/component/jms/issues/JmsSpringSimpleTXResequencerTest.xml");
+    }
+
+    @Test
+    public void testResequence() throws Exception {
+        MockEndpoint mock = getMockEndpoint("mock:result");
+        mock.expectedBodiesReceived(1, 2, 3, 4, 5);
+
+        template.sendBody("activemq:queue:in", 1);
+        template.sendBody("activemq:queue:in", 5);
+        template.sendBody("activemq:queue:in", 3);
+        template.sendBody("activemq:queue:in", 2);
+        template.sendBody("activemq:queue:in", 4);
+
+        assertMockEndpointsSatisfied();
+    }
+
+}
\ No newline at end of file

Propchange: camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsSpringSimpleTXResequencerTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsSpringSimpleTXResequencerTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Copied: camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/issues/JmsSpringSimpleTXResequencerTest.xml
(from r832403, camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/issues/JmsSpringResequencerTest-context.xml)
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/issues/JmsSpringSimpleTXResequencerTest.xml?p2=camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/issues/JmsSpringSimpleTXResequencerTest.xml&p1=camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/issues/JmsSpringResequencerTest-context.xml&r1=832403&r2=832470&rev=832470&view=diff
==============================================================================
--- camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/issues/JmsSpringResequencerTest-context.xml
(original)
+++ camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/issues/JmsSpringSimpleTXResequencerTest.xml
Tue Nov  3 16:32:06 2009
@@ -20,43 +20,36 @@
        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">
-       
+
     <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
-        <jmxAgent id="agent" disabled="true" />
         <route>
-           <from uri="activemq:queue:in1"/>           
-  		   <resequence>  		        
-    			<simple>body</simple>
-    			<to uri="mock:result"/>
-    			<batch-config batchSize="100" batchTimeout="10000"/>    			
-  			</resequence>
-  			
-		</route>
-		
-		<route>
-           <from uri="activemq:queue:in2"/>           
-  		   <resequence>  		        
-    			<simple>header.num</simple>    			
-    			<to uri="mock:result"/>
-    			<stream-config timeout="2000"/>
-  			</resequence>
-		</route>          
-        
+            <from uri="activemq:queue:in"/>
+            <resequence>
+                <simple>body</simple>
+                <to uri="activemq:queue:out"/>
+                <stream-config capacity="100" timeout="5000"/>
+            </resequence>
+        </route>
+
+        <route>
+            <from uri="activemq:queue:out"/>
+            <to uri="mock:result"/>
+        </route>
     </camelContext>
-    
 
     <bean id="jmsConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
         <property name="brokerURL" value="vm://localhost?broker.persistent=false&amp;broker.useJmx=false"/>
     </bean>
 
-    <bean id="jmsConfig" class="org.apache.camel.component.jms.JmsConfiguration">
+    <bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent">
         <property name="connectionFactory" ref="jmsConnectionFactory"/>
-        <property name="transacted" value="false"/>
-        <property name="concurrentConsumers" value="10"/>
+        <property name="transacted" value="true"/>
+        <property name="transactionManager" ref="jmsTransactionManager"/>
     </bean>
 
-    <bean id="activemq" class="org.apache.camel.component.jms.JmsComponent">
-        <property name="configuration" ref="jmsConfig"/>
+    <bean id="jmsTransactionManager" class="org.springframework.jms.connection.JmsTransactionManager">
+        <property name="connectionFactory" ref="jmsConnectionFactory"/>
     </bean>
 
+
 </beans>

Propchange: camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/issues/JmsSpringSimpleTXResequencerTest.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/issues/JmsSpringSimpleTXResequencerTest.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/issues/JmsSpringSimpleTXResequencerTest.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml



Mime
View raw message