1 25 package org.objectweb.easybeans.tests.messagedriven.containermanaged.basic; 26 27 import static org.objectweb.easybeans.tests.common.ejbs.entity.callbacklogger.CallbackType.ON_MESSAGE; 28 import static org.objectweb.easybeans.tests.common.ejbs.entity.callbacklogger.OperationType.UNDEFINED; 29 30 import org.objectweb.easybeans.tests.common.ejbs.mdb.containermanaged.basic.MDBQueue00; 31 import org.objectweb.easybeans.tests.common.ejbs.mdb.containermanaged.basic.MDBQueue01; 32 import org.objectweb.easybeans.tests.common.ejbs.mdb.containermanaged.basic.MDBTopic00; 33 import org.objectweb.easybeans.tests.common.ejbs.mdb.containermanaged.basic.MDBTopic01; 34 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.callbacklogger.CallbackChecker; 35 import org.objectweb.easybeans.tests.common.jms.JMSManager; 36 import org.testng.annotations.AfterClass; 37 import org.testng.annotations.AfterMethod; 38 import org.testng.annotations.BeforeClass; 39 import org.testng.annotations.BeforeMethod; 40 import org.testng.annotations.Test; 41 42 54 public class TestMDBBasic00 { 55 56 59 private JMSManager jmsTopic; 60 61 64 private JMSManager jmsQueue; 65 66 69 private CallbackChecker checker; 70 71 75 @BeforeClass 76 public void startUp00() throws Exception { 77 jmsQueue = new JMSManager(JMSManager.DEFAULT_QUEUE_CONNECTION_FACTORY, JMSManager.DEFAULT_QUEUE); 78 jmsTopic = new JMSManager(JMSManager.DEFAULT_TOPIC_CONNECTION_FACTORY, JMSManager.DEFAULT_TOPIC); 79 checker = new CallbackChecker(); 80 } 81 82 86 @BeforeMethod 87 public void startUp01() throws Exception { 88 checker.deleteAll(); 89 } 90 91 98 @Test 99 public void testTopic00() throws Exception { 100 jmsTopic.sendControlMessage(MDBTopic00.MESSAGE_TYPE, UNDEFINED); 101 checker.check(MDBTopic00.class.getName(), ON_MESSAGE); 102 } 103 104 111 @Test 112 public void testTopic01() throws Exception { 113 jmsTopic.sendControlMessage(MDBTopic01.MESSAGE_TYPE, UNDEFINED); 114 checker.check(MDBTopic01.class.getName(), ON_MESSAGE); 115 } 116 117 124 @Test 125 public void testQueue00() throws Exception { 126 jmsQueue.sendControlMessage(MDBQueue00.MESSAGE_TYPE, UNDEFINED); 127 checker.check(MDBQueue00.class.getName(), ON_MESSAGE); 128 } 129 130 137 @Test 138 public void testQueue01() throws Exception { 139 jmsQueue.sendControlMessage(MDBQueue01.MESSAGE_TYPE, UNDEFINED); 140 checker.check(MDBQueue01.class.getName(), ON_MESSAGE); 141 } 142 143 147 @AfterMethod 148 public void tearDown() throws Exception { 149 } 151 152 156 @AfterClass 157 public void tearDownClass() throws Exception { 158 jmsQueue.close(); 159 jmsTopic.close(); 160 } 161 } 162 | Popular Tags |