001: /**
002: * EasyBeans
003: * Copyright (C) 2006 Bull S.A.S.
004: * Contact: easybeans@ow2.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * --------------------------------------------------------------------------
022: * $Id: TestMDBBeanManagedTimeoutAccess.java 1970 2007-10-16 11:49:25Z benoitf $
023: * --------------------------------------------------------------------------
024: */package org.ow2.easybeans.tests.timerservice.timeout.mdb.beanmanaged;
025:
026: import org.ow2.easybeans.tests.common.ejbs.entity.callbacklogger.OperationType;
027: import org.ow2.easybeans.tests.common.ejbs.mdb.beanmanaged.timer.MDBBeanManagedTimeoutCallbackAccess00;
028: import org.ow2.easybeans.tests.common.jms.JMSManager;
029: import org.ow2.easybeans.tests.timerservice.timeout.base.BaseTestTimeout;
030: import org.testng.annotations.AfterClass;
031: import org.testng.annotations.AfterMethod;
032: import org.testng.annotations.BeforeClass;
033: import org.testng.annotations.Test;
034:
035: /**
036: * Verifies if the timeout callback can perform the operations defined by the specification.
037: * @reference JSR 220 - EJB 3.0 Core - Chapter 5 - Table 3
038: * @requirement Application Server must be running.<br>
039: * MDBs:<li>org.ow2.easybeans.tests.common.ejbs.mdb.beanmanaged.
040: * timer.MDBBeanManagedTimeoutCallbackAccess00</li>
041: * (Ant task: install.jar.tests.timerservice)
042: * @author Eduardo Studzinski Estima de Castro
043: * @author Gisele Pinheiro Souza
044: */
045: public class TestMDBBeanManagedTimeoutAccess extends BaseTestTimeout {
046:
047: /**
048: * JMS Manager.
049: */
050: private JMSManager jmsQueue;
051:
052: /**
053: * MDB which must perform the access.
054: * @return name
055: */
056: @Override
057: public String getBeanName() {
058: return MDBBeanManagedTimeoutCallbackAccess00.class.getName();
059: }
060:
061: /**
062: * Creates the JMS manager.
063: * @throws Exception if there is a problem.
064: */
065: @Override
066: @BeforeClass
067: public void startUp() throws Exception {
068: super .startUp();
069: jmsQueue = new JMSManager(
070: JMSManager.DEFAULT_QUEUE_CONNECTION_FACTORY,
071: JMSManager.DEFAULT_QUEUE);
072: }
073:
074: /**
075: * Tests if a timeout callback method is allowed to access an EJB.
076: * @throws Exception if a problem occurs.
077: */
078: @Override
079: @Test
080: public void testAccessEJB00() throws Exception {
081: super .testAccessEJB00();
082: }
083:
084: /**
085: * Tests if a timeout callback method is allowed to access the Resource
086: * Manager.
087: * @throws Exception if a problem occurs.
088: */
089: @Override
090: @Test
091: public void testAccessResourceManager00() throws Exception {
092: super .testAccessResourceManager00();
093: }
094:
095: /**
096: * Tests if a timeout callback method is allowed to access the Entity
097: * Manager.
098: * @throws Exception if a problem occurs.
099: */
100: @Override
101: @Test
102: public void testAccessEntityManager00() throws Exception {
103: super .testAccessEntityManager00();
104: }
105:
106: /**
107: * Tests if a timeout callback method is allowed to access the Entity
108: * Manager Factory.
109: * @throws Exception if a problem occurs.
110: */
111: @Override
112: @Test
113: public void testAccessEntityManagerFactory00() throws Exception {
114: super .testAccessEntityManagerFactory00();
115: }
116:
117: /**
118: * Tests if a timeout callback method is allowed to access the Timer
119: * Service.
120: * @throws Exception if a problem occurs.
121: */
122: @Override
123: @Test
124: public void testAccessTimerService00() throws Exception {
125: super .testAccessTimerService00();
126: }
127:
128: /**
129: * Tests if a timeout callback method is allowed to access the
130: * UserTransaction.
131: * @throws Exception if a problem occurs.
132: */
133: @Override
134: @Test
135: public void testAccessUserTransaction00() throws Exception {
136: super .testAccessUserTransaction00();
137: }
138:
139: /**
140: * Clears logs.
141: * @throws Exception if a problem occurs.
142: */
143: @Override
144: @AfterMethod
145: public void tearDownMethod() throws Exception {
146: super .tearDownMethod();
147: }
148:
149: /**
150: * Closes the JMS Queue.
151: * @throws Exception if a problem occurs.
152: */
153: @AfterClass
154: public void tearDownClass() throws Exception {
155: jmsQueue.close();
156: }
157:
158: /**
159: * Starts the timer.
160: * @param type operation type
161: * @throws Exception if a problem occurs.
162: */
163: @Override
164: public void requestStartTimer(final OperationType type)
165: throws Exception {
166: jmsQueue.sendControlMessage(getBeanName(), type);
167: }
168:
169: }
|