1 17 package org.apache.servicemix.jbi.messaging; 18 19 import org.apache.activemq.broker.BrokerService; 20 import org.apache.activemq.xbean.BrokerFactoryBean; 21 import org.apache.servicemix.jbi.nmr.flow.Flow; 22 import org.apache.servicemix.jbi.nmr.flow.jca.JCAFlow; 23 import org.springframework.core.io.ClassPathResource; 24 25 28 public class JcaFlowTransactionTest extends AbstractClusteredTransactionTest { 29 30 protected BrokerService broker; 31 32 protected void setUp() throws Exception { 33 BrokerFactoryBean bfb = new BrokerFactoryBean(new ClassPathResource("org/apache/servicemix/jbi/nmr/flow/jca/broker.xml")); 34 bfb.afterPropertiesSet(); 35 broker = bfb.getBroker(); 36 super.setUp(); 37 } 38 39 protected void tearDown() throws Exception { 40 super.tearDown(); 41 broker.stop(); 42 } 43 44 protected Flow createFlow() { 45 JCAFlow flow = new JCAFlow(); 46 flow.setJmsURL("tcp://localhost:61216"); 47 flow.setTransactionContextManager(tcm); 48 return flow; 49 } 50 51 public void testSyncSendSyncReceive() throws Exception { 52 try { 53 runSimpleTest(true, true); 54 fail("sendSync can not be used"); 55 } catch (Exception e) { 56 } 58 } 59 60 public void testSyncSendAsyncReceive() throws Exception { 61 try { 62 runSimpleTest(true, false); 63 fail("sendSync can not be used"); 64 } catch (Exception e) { 65 } 67 } 68 69 } 70 | Popular Tags |