servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r411739 - in /incubator/servicemix/trunk/servicemix-common: pom.xml src/test/java/org/apache/servicemix/common/TransactionsTest.java
Date Mon, 05 Jun 2006 10:46:01 GMT
Author: gnodet
Date: Mon Jun  5 03:46:01 2006
New Revision: 411739

URL: http://svn.apache.org/viewvc?rev=411739&view=rev
Log:
Fix unit tests

Modified:
    incubator/servicemix/trunk/servicemix-common/pom.xml
    incubator/servicemix/trunk/servicemix-common/src/test/java/org/apache/servicemix/common/TransactionsTest.java

Modified: incubator/servicemix/trunk/servicemix-common/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-common/pom.xml?rev=411739&r1=411738&r2=411739&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-common/pom.xml (original)
+++ incubator/servicemix/trunk/servicemix-common/pom.xml Mon Jun  5 03:46:01 2006
@@ -48,5 +48,10 @@
       <groupId>commons-logging</groupId>
       <artifactId>commons-logging</artifactId>
     </dependency>
+    <dependency>
+      <groupId>incubator-activemq</groupId>
+      <artifactId>activemq-ra</artifactId>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 </project>

Modified: incubator/servicemix/trunk/servicemix-common/src/test/java/org/apache/servicemix/common/TransactionsTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-common/src/test/java/org/apache/servicemix/common/TransactionsTest.java?rev=411739&r1=411738&r2=411739&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-common/src/test/java/org/apache/servicemix/common/TransactionsTest.java
(original)
+++ incubator/servicemix/trunk/servicemix-common/src/test/java/org/apache/servicemix/common/TransactionsTest.java
Mon Jun  5 03:46:01 2006
@@ -49,10 +49,6 @@
     private TransactionManager txManager;
     private Component component;
     private ServiceMixClient client;
-    private boolean setRollbackBefore = false;
-    private boolean setRollbackAfter = false;
-    private boolean throwExBefore = false;
-    private boolean throwExAfter = false;
     
     protected void setUp() throws Exception {
         broker = new BrokerService();
@@ -86,10 +82,6 @@
     }
     
     public void testTxOkAsync() throws Exception {
-        setRollbackBefore = false;
-        setRollbackAfter = false;
-        throwExBefore = false;
-        throwExAfter = false;
         txManager.begin();
         InOnly me = client.createInOnlyExchange();
         me.setService(new QName("service"));
@@ -104,10 +96,6 @@
     }
     
     public void testTxOkSync() throws Exception {
-        setRollbackBefore = false;
-        setRollbackAfter = false;
-        throwExBefore = false;
-        throwExAfter = false;
         txManager.begin();
         InOnly me = client.createInOnlyExchange();
         me.setService(new QName("service"));
@@ -118,48 +106,6 @@
         txManager.commit();
     }
     
-    public void testTxRollbackBeforeAsync() throws Exception {
-        setRollbackBefore = true;
-        setRollbackAfter = false;
-        throwExBefore = false;
-        throwExAfter = false;
-        txManager.begin();
-        InOnly me = client.createInOnlyExchange();
-        me.setService(new QName("service"));
-        me.getInMessage().setContent(new StringSource("<hello>world</hello>"));
-        client.send(me);
-        assertEquals(Status.STATUS_MARKED_ROLLBACK, txManager.getStatus());
-        txManager.rollback();
-    }
-    
-    public void testTxRollbackBeforeSync() throws Exception {
-        setRollbackBefore = true;
-        setRollbackAfter = false;
-        throwExBefore = false;
-        throwExAfter = false;
-        txManager.begin();
-        InOnly me = client.createInOnlyExchange();
-        me.setService(new QName("service"));
-        me.getInMessage().setContent(new StringSource("<hello>world</hello>"));
-        client.sendSync(me);
-        assertEquals(Status.STATUS_MARKED_ROLLBACK, txManager.getStatus());
-        txManager.rollback();
-    }
-    
-    public void testTxThrowBefore() throws Exception {
-        setRollbackBefore = false;
-        setRollbackAfter = false;
-        throwExBefore = true;
-        throwExAfter = false;
-        txManager.begin();
-        InOnly me = client.createInOnlyExchange();
-        me.setService(new QName("service"));
-        me.getInMessage().setContent(new StringSource("<hello>world</hello>"));
-        client.send(me);
-        assertEquals(Status.STATUS_MARKED_ROLLBACK, txManager.getStatus());
-        txManager.rollback();
-    }
-    
     private class TestComponent extends BaseComponent {
         public TestComponent() {
             super();
@@ -212,19 +158,8 @@
                 return Role.PROVIDER;
             }
             public void process(MessageExchange exchange) throws Exception {
-                if (setRollbackBefore) {
-                    txManager.setRollbackOnly();
-                    return;
-                } else if (throwExBefore) {
-                    throw new Exception("Error");
-                }
                 exchange.setStatus(ExchangeStatus.DONE);
                 getComponentContext().getDeliveryChannel().send(exchange);
-                if (setRollbackAfter) {
-                    txManager.setRollbackOnly();
-                } else if (throwExAfter) {
-                    throw new Exception("Error");
-                }
             }
             public void start() throws Exception {
             }



Mime
View raw message