1 22 package org.jboss.test.jbossmessaging.ra; 23 24 import javax.jms.*; 25 import javax.naming.InitialContext ; 26 27 import org.jboss.test.jbossmessaging.JMSTestCase; 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 43 44 public class RaJMSSessionUnitTestCase extends JMSTestCase 45 { 46 public RaJMSSessionUnitTestCase(String name) 47 { 48 super(name); 49 } 50 51 public void testSendToQueueAndTopic() 52 throws Exception 53 { 54 JMSSessionHome home = (JMSSessionHome) getInitialContext().lookup("JMSSession"); 55 JMSSession session = home.create(); 56 session.sendToQueueAndTopic(); 57 } 58 59 public static Test suite() throws Exception 60 { 61 TestSuite suite = new TestSuite(); 62 63 suite.addTest(new JBossTestSetup(new TestSuite(RaJMSSessionUnitTestCase.class)) 64 { 65 protected void setUp() throws Exception 66 { 67 ClassLoader loader = Thread.currentThread().getContextClassLoader(); 68 String resourceName = getJMSResourceRelativePathname("test-destinations-service.xml") ; 69 deploy (loader.getResource(resourceName).toString()); 70 deploy ("jmsra.jar"); 71 } 72 protected void tearDown() throws Exception 73 { 74 ClassLoader loader = Thread.currentThread().getContextClassLoader(); 75 String resourceName = getJMSResourceRelativePathname("test-destinations-service.xml") ; 76 undeploy ("jmsra.jar"); 77 undeploy (loader.getResource(resourceName).toString()); 78 } 79 }); 80 81 return suite; 82 } 83 } 84 85 86 87 88 89 | Popular Tags |