KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > tests > timerservice > timeout > mdb > containermanaged > TestMDBTimeoutAccess


1 /**
2  * EasyBeans
3  * Copyright (C) 2006 Bull S.A.S.
4  * Contact: easybeans@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id: TestMDBTimeoutAccess.java 979 2006-07-28 13:19:50Z studzine $
23  * --------------------------------------------------------------------------
24  */

25 package org.objectweb.easybeans.tests.timerservice.timeout.mdb.containermanaged;
26
27 import org.objectweb.easybeans.tests.common.ejbs.entity.callbacklogger.OperationType;
28 import org.objectweb.easybeans.tests.common.ejbs.mdb.containermanaged.timer.MDBTimeoutCallbackAccess00;
29 import org.objectweb.easybeans.tests.common.jms.JMSManager;
30 import org.objectweb.easybeans.tests.timerservice.timeout.base.BaseTestTimeout;
31 import org.testng.annotations.AfterClass;
32 import org.testng.annotations.AfterMethod;
33 import org.testng.annotations.BeforeClass;
34 import org.testng.annotations.Test;
35
36
37 /**
38  * Verifies if the timeout callback can perform the operations defined by the specification.
39  * @reference JSR 220 - EJB 3.0 Core - Chapter 5 - Table 3
40  * @requirement Application Server must be running.<br>
41  * MDBs:<li>org.objectweb.easybeans.tests.common.ejbs.mdb.containermanaged.timer.MDBTimeoutCallbackAccess00</li>
42 * (Ant task: install.jar.tests.timerservice)
43  * @author Eduardo Studzinski Estima de Castro
44  * @author Gisele Pinheiro Souza
45  */

46 public class TestMDBTimeoutAccess extends BaseTestTimeout{
47
48     /**
49      * JMS Manager.
50      */

51     private JMSManager jmsQueue;
52
53     /**
54      * MDB which must perform the access.
55      * @return name
56      */

57     @Override JavaDoc
58     public String JavaDoc getBeanName() {
59         return MDBTimeoutCallbackAccess00.class.getName();
60     }
61
62     /**
63      * Creates the JMS manager.
64      * @throws Exception if there is a problem.
65      */

66     @Override JavaDoc
67     @BeforeClass
68     public void startUp() throws Exception JavaDoc {
69         super.startUp();
70         jmsQueue = new JMSManager(JMSManager.DEFAULT_QUEUE_CONNECTION_FACTORY, JMSManager.DEFAULT_QUEUE);
71     }
72
73     /**
74      * Tests if a timeout callback method is allowed to access an EJB.
75      * @throws Exception if a problem occurs.
76      */

77     @Override JavaDoc
78     @Test
79     public void testAccessEJB00() throws Exception JavaDoc {
80         super.testAccessEJB00();
81     }
82
83     /**
84      * Tests if a timeout callback method is allowed to access the Resource
85      * Manager.
86      * @throws Exception if a problem occurs.
87      */

88     @Override JavaDoc
89     @Test
90     public void testAccessResourceManager00() throws Exception JavaDoc {
91         super.testAccessResourceManager00();
92     }
93
94     /**
95      * Tests if a timeout callback method is allowed to access the Entity
96      * Manager.
97      * @throws Exception if a problem occurs.
98      */

99     @Override JavaDoc
100     @Test
101     public void testAccessEntityManager00() throws Exception JavaDoc {
102         super.testAccessEntityManager00();
103     }
104
105     /**
106      * Tests if a timeout callback method is allowed to access the Entity
107      * Manager Factory.
108      * @throws Exception if a problem occurs.
109      */

110     @Override JavaDoc
111     @Test
112     public void testAccessEntityManagerFactory00() throws Exception JavaDoc {
113         super.testAccessEntityManagerFactory00();
114     }
115
116     /**
117      * Tests if a timeout callback method is allowed to access the Timer
118      * Service.
119      * @throws Exception if a problem occurs.
120      */

121     @Override JavaDoc
122     @Test
123     public void testAccessTimerService00() throws Exception JavaDoc {
124         super.testAccessTimerService00();
125     }
126
127     /**
128      * Tests if a timeout callback method is allowed to access the
129      * UserTransaction.
130      * @throws Exception if a problem occurs.
131      */

132     @Override JavaDoc
133     @Test
134     public void testAccessUserTransaction00() throws Exception JavaDoc {
135         super.testAccessUserTransaction00();
136     }
137
138     /**
139      * Clears logs.
140      * @throws Exception if a problem occurs.
141      */

142     @Override JavaDoc
143     @AfterMethod
144     public void tearDownMethod() throws Exception JavaDoc {
145         super.tearDownMethod();
146     }
147
148     /**
149      * Closes the JMS Queue.
150      * @throws Exception if a problem occurs.
151      */

152     @AfterClass
153     public void tearDownClass() throws Exception JavaDoc {
154         jmsQueue.close();
155     }
156
157     /**
158      * Starts the timer.
159      * @param type operation type
160      * @throws Exception if a problem occurs.
161      */

162     @Override JavaDoc
163     public void requestStartTimer(final OperationType type) throws Exception JavaDoc{
164         jmsQueue.sendControlMessage(getBeanName(), type);
165     }
166
167 }
168
Popular Tags