1 17 package org.apache.servicemix.jbi.nmr.flow.jms; 18 19 import javax.transaction.TransactionManager ; 20 21 import org.apache.geronimo.transaction.ExtendedTransactionManager; 22 import org.apache.geronimo.transaction.context.TransactionContextManager; 23 import org.apache.servicemix.jbi.container.JBIContainer; 24 import org.apache.servicemix.jbi.nmr.flow.jca.JCAFlow; 25 import org.jencks.factory.GeronimoTransactionManagerFactoryBean; 26 import org.jencks.factory.TransactionContextManagerFactoryBean; 27 import org.jencks.factory.TransactionManagerFactoryBean; 28 29 public class StatelessJcaFlowTest extends StatelessJmsFlowTest { 30 31 private TransactionContextManager tcm; 32 private TransactionManager tm; 33 34 protected void setUp() throws Exception { 35 TransactionManagerFactoryBean tmcf = new TransactionManagerFactoryBean(); 36 tmcf.afterPropertiesSet(); 37 ExtendedTransactionManager etm = (ExtendedTransactionManager) tmcf.getObject(); 38 TransactionContextManagerFactoryBean tcmfb = new TransactionContextManagerFactoryBean(); 39 tcmfb.setTransactionManager(etm); 40 tcmfb.afterPropertiesSet(); 41 tcm = (TransactionContextManager) tcmfb.getObject(); 42 GeronimoTransactionManagerFactoryBean gtmfb = new GeronimoTransactionManagerFactoryBean(); 43 gtmfb.setTransactionContextManager(tcm); 44 gtmfb.afterPropertiesSet(); 45 tm = (TransactionManager ) gtmfb.getObject(); 46 super.setUp(); 47 } 48 49 protected JBIContainer createContainer(String name) throws Exception { 50 JBIContainer container = new JBIContainer(); 51 container.setName(name); 52 JCAFlow flow = new JCAFlow(); 53 flow.setJmsURL("tcp://localhost:61616"); 54 flow.setTransactionContextManager(tcm); 55 container.setTransactionManager(tm); 56 container.setFlow(flow); 57 container.setUseMBeanServer(false); 58 container.setEmbedded(true); 59 container.init(); 60 container.start(); 61 return container; 62 } 63 64 65 } 66 | Popular Tags |