1 22 package org.jboss.test.jmsra.test; 23 24 import javax.jms.*; 25 import javax.naming.InitialContext ; 26 27 import org.jboss.test.JBossTestCase; 28 import org.jboss.test.JBossTestSetup; 29 import org.jboss.test.client.test.AppClientUnitTestCase; 30 31 import org.jboss.test.jmsra.bean.*; 32 33 import junit.framework.Test; 34 import junit.framework.TestSuite; 35 36 42 43 public class RaJMSSessionUnitTestCase extends JBossTestCase 44 { 45 public RaJMSSessionUnitTestCase(String name) 46 { 47 super(name); 48 } 49 50 public void testSendToQueueAndTopic() 51 throws Exception 52 { 53 JMSSessionHome home = (JMSSessionHome) getInitialContext().lookup("JMSSession"); 54 JMSSession session = home.create(); 55 session.sendToQueueAndTopic(); 56 } 57 58 public static Test suite() throws Exception 59 { 60 TestSuite suite = new TestSuite(); 61 62 suite.addTest(new JBossTestSetup(new TestSuite(RaJMSSessionUnitTestCase.class)) 63 { 64 protected void setUp() throws Exception 65 { 66 ClassLoader loader = Thread.currentThread().getContextClassLoader(); 67 deploy (loader.getResource("messaging/test-destinations-service.xml").toString()); 68 deploy ("jmsra.jar"); 69 } 70 protected void tearDown() throws Exception 71 { 72 ClassLoader loader = Thread.currentThread().getContextClassLoader(); 73 undeploy ("jmsra.jar"); 74 undeploy (loader.getResource("messaging/test-destinations-service.xml").toString()); 75 } 76 }); 77 78 return suite; 79 } 80 } 81 82 83 84 85 86 | Popular Tags |