1 25 package org.objectweb.easybeans.tests.transaction.beanmanaged; 26 27 import static org.objectweb.easybeans.tests.common.ejbs.entity.callbacklogger.CallbackType.ON_MESSAGE; 28 import static org.objectweb.easybeans.tests.common.helper.EJBHelper.getBeanRemoteInstance; 29 30 import java.util.ArrayList ; 31 import java.util.List ; 32 33 import org.objectweb.easybeans.tests.common.ejbs.entity.callbacklogger.OperationType; 34 import org.objectweb.easybeans.tests.common.ejbs.mdb.beanmanaged.transaction.MDBBMTransaction; 35 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.callbacklogger.ItfCallbackLoggerAccess; 36 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.callbacklogger.SLSBCallbackLoggerAccess; 37 import org.objectweb.easybeans.tests.common.jms.JMSManager; 38 import org.testng.annotations.AfterClass; 39 import org.testng.annotations.AfterMethod; 40 import org.testng.annotations.BeforeClass; 41 import org.testng.annotations.Test; 42 43 44 56 public class TestTransactionMDB { 57 58 61 private JMSManager jmsQueue; 62 63 66 private ItfCallbackLoggerAccess beanLogger; 67 68 72 @BeforeClass 73 public void startUp00() throws Exception { 74 jmsQueue = new JMSManager(JMSManager.DEFAULT_QUEUE_CONNECTION_FACTORY, JMSManager.DEFAULT_QUEUE); 75 beanLogger = getBeanRemoteInstance(SLSBCallbackLoggerAccess.class, ItfCallbackLoggerAccess.class); 76 } 77 78 85 @Test 86 public void testBeanManaged00() throws Exception { 87 jmsQueue.sendControlMessage(MDBBMTransaction.MESSAGE_TYPE, OperationType.UNDEFINED); 88 89 List <String > arEvent = new ArrayList <String >(); 91 92 arEvent.add(MDBBMTransaction.class.getName()); 93 94 beanLogger.verifyCallbackOrder(MDBBMTransaction.class, ON_MESSAGE, arEvent 95 .toArray(new String [0])); 96 } 97 98 102 @AfterMethod 103 public void tearDown() throws Exception { 104 beanLogger.deleteAll(); 105 } 106 107 111 @AfterClass 112 public void tearDownClass() throws Exception { 113 jmsQueue.close(); 114 } 115 } 116 | Popular Tags |