1 25 package org.objectweb.easybeans.tests.messagedriven.containermanaged.mdbinterface; 26 27 import static org.objectweb.easybeans.tests.common.ejbs.entity.callbacklogger.CallbackType.UNDEFINED; 28 import static org.objectweb.easybeans.tests.common.ejbs.entity.callbacklogger.OperationType.MESSAGE_DRIVEN_CONTEXT; 29 import static org.objectweb.easybeans.tests.common.helper.EJBHelper.getBeanRemoteInstance; 30 31 import java.util.ArrayList ; 32 import java.util.List ; 33 34 import org.objectweb.easybeans.tests.common.ejbs.entity.callbacklogger.OperationType; 35 import org.objectweb.easybeans.tests.common.ejbs.mdb.containermanaged.mdbinterface.MDBInterface00; 36 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.callbacklogger.ItfOperationLoggerAccess; 37 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.callbacklogger.SLSBOperationLoggerAccess; 38 import org.objectweb.easybeans.tests.common.jms.JMSManager; 39 import org.testng.annotations.AfterClass; 40 import org.testng.annotations.AfterMethod; 41 import org.testng.annotations.BeforeClass; 42 import org.testng.annotations.Test; 43 44 54 public class TestMDBInterface { 55 56 59 private JMSManager jmsQueue; 60 61 64 private ItfOperationLoggerAccess beanLogger; 65 66 70 @BeforeClass 71 public void startUp00() throws Exception { 72 jmsQueue = new JMSManager(JMSManager.DEFAULT_QUEUE_CONNECTION_FACTORY, JMSManager.DEFAULT_QUEUE); 73 beanLogger = getBeanRemoteInstance(SLSBOperationLoggerAccess.class, ItfOperationLoggerAccess.class); 74 } 75 76 82 @Test 83 public void testInterface00() throws Exception { 84 jmsQueue.sendControlMessage(MDBInterface00.MESSAGE_TYPE, OperationType.MESSAGE_DRIVEN_CONTEXT); 85 86 List <String > arEvent = new ArrayList <String >(); 88 89 arEvent.add(MDBInterface00.class.getName()); 90 91 beanLogger.verifyOperation(MDBInterface00.class, UNDEFINED, arEvent 92 .toArray(new String [0]), MESSAGE_DRIVEN_CONTEXT); 93 } 94 95 99 @AfterMethod 100 public void tearDown() throws Exception { 101 beanLogger.deleteAll(); 102 } 103 104 108 @AfterClass 109 public void tearDownClass() throws Exception { 110 jmsQueue.close(); 111 } 112 } 113 | Popular Tags |