KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > jmsra > test > RaJMSSessionUnitTestCase


1 /*
2   * JBoss, Home of Professional Open Source
3   * Copyright 2005, JBoss Inc., and individual contributors as indicated
4   * by the @authors tag. See the copyright.txt in the distribution for a
5   * full listing of individual contributors.
6   *
7   * This is free software; you can redistribute it and/or modify it
8   * under the terms of the GNU Lesser General Public License as
9   * published by the Free Software Foundation; either version 2.1 of
10   * the License, or (at your option) any later version.
11   *
12   * This software is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15   * Lesser General Public License for more details.
16   *
17   * You should have received a copy of the GNU Lesser General Public
18   * License along with this software; if not, write to the Free
19   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21   */

22 package org.jboss.test.jmsra.test;
23
24 import javax.jms.*;
25 import javax.naming.InitialContext JavaDoc;
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 /**
37  * Test for jmsra.
38  *
39  * @author <a HREF="mailto:Adrian@jboss.org">Adrian Brock</a>
40  * @version $Revision: 37406 $
41  */

42
43 public class RaJMSSessionUnitTestCase extends JBossTestCase
44 {
45    public RaJMSSessionUnitTestCase(String JavaDoc name)
46    {
47       super(name);
48    }
49
50    public void testSendToQueueAndTopic()
51       throws Exception JavaDoc
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 JavaDoc
59    {
60       TestSuite suite = new TestSuite();
61
62       suite.addTest(new JBossTestSetup(new TestSuite(RaJMSSessionUnitTestCase.class))
63       {
64          protected void setUp() throws Exception JavaDoc
65          {
66             ClassLoader JavaDoc 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 JavaDoc
71          {
72             ClassLoader JavaDoc 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