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: TestSLBeanManagedTimeoutAccess.java 1970 2007-10-16 11:49:25Z benoitf $
023: * --------------------------------------------------------------------------
024: */package org.ow2.easybeans.tests.timerservice.timeout.stateless.beanmanaged;
025:
026: import static org.ow2.easybeans.tests.common.helper.EJBHelper.getBeanRemoteInstance;
027:
028: import org.ow2.easybeans.tests.common.ejbs.base.timer.ItfCreateTimer;
029: import org.ow2.easybeans.tests.common.ejbs.entity.callbacklogger.OperationType;
030: import org.ow2.easybeans.tests.common.ejbs.stateless.beanmanaged.timer.SLSBBMTTimeoutCallbackAccess00;
031: import org.ow2.easybeans.tests.timerservice.timeout.base.BaseTestTimeout;
032: import org.testng.annotations.AfterMethod;
033: import org.testng.annotations.BeforeClass;
034: import org.testng.annotations.BeforeMethod;
035: import org.testng.annotations.Test;
036:
037: /**
038: * Verifies if the timeout callback can perform the operations defined by the specification.
039: * @reference JSR 220 - EJB 3.0 Core - Chapter 4 - Table 2
040: * @requirement Application Server must be running.<br>
041: * (Ant task: install.jar.tests.timerservice)
042: * @author Eduardo Studzinski Estima de Castro
043: * @author Gisele Pinheiro Souza
044: */
045: public class TestSLBeanManagedTimeoutAccess extends BaseTestTimeout {
046:
047: /**
048: * Bean.
049: */
050: private ItfCreateTimer bean;
051:
052: /**
053: * Startup.
054: * @throws Exception if there is a problem.
055: */
056: @Override
057: @BeforeClass
058: public void startUp() throws Exception {
059: super .startUp();
060: }
061:
062: /**
063: * Creates a bean instance.
064: * @throws Exception if there is a problem.
065: */
066: @BeforeMethod
067: public void startBean() throws Exception {
068: bean = getBeanRemoteInstance(
069: SLSBBMTTimeoutCallbackAccess00.class,
070: ItfCreateTimer.class);
071: }
072:
073: /**
074: * Gets the name of the bean where the timer was started.
075: * @return name
076: */
077: @Override
078: public String getBeanName() {
079: return SLSBBMTTimeoutCallbackAccess00.class.getName();
080: }
081:
082: /**
083: * Starts the timer.
084: * @param type operation type
085: */
086: @Override
087: public void requestStartTimer(final OperationType type) {
088: bean.startTimer(ItfCreateTimer.DURATION, type);
089: }
090:
091: /**
092: * Tests if a timeout callback method is allowed to access an EJB.
093: * @throws Exception if a problem occurs.
094: */
095: @Override
096: @Test
097: public void testAccessEJB00() throws Exception {
098: super .testAccessEJB00();
099: }
100:
101: /**
102: * Tests if a timeout callback method is allowed to access the Resource
103: * Manager.
104: * @throws Exception if a problem occurs.
105: */
106: @Override
107: @Test
108: public void testAccessResourceManager00() throws Exception {
109: super .testAccessResourceManager00();
110: }
111:
112: /**
113: * Tests if a timeout callback method is allowed to access the Entity
114: * Manager.
115: * @throws Exception if a problem occurs.
116: */
117: @Override
118: @Test
119: public void testAccessEntityManager00() throws Exception {
120: super .testAccessEntityManager00();
121: }
122:
123: /**
124: * Tests if a timeout callback method is allowed to access the Entity
125: * Manager Factory.
126: * @throws Exception if a problem occurs.
127: */
128: @Override
129: @Test
130: public void testAccessEntityManagerFactory00() throws Exception {
131: super .testAccessEntityManagerFactory00();
132: }
133:
134: /**
135: * Tests if a timeout callback method is allowed to access the Timer
136: * Service.
137: * @throws Exception if a problem occurs.
138: */
139: @Override
140: @Test
141: public void testAccessTimerService00() throws Exception {
142: super .testAccessTimerService00();
143: }
144:
145: /**
146: * Tests if a timeout callback method is allowed to access the
147: * UserTransaction.
148: * @throws Exception if a problem occurs.
149: */
150: @Override
151: @Test
152: public void testAccessUserTransaction00() throws Exception {
153: super .testAccessUserTransaction00();
154: }
155:
156: /**
157: * Clears logs.
158: * @throws Exception if a problem occurs.
159: */
160: @Override
161: @AfterMethod
162: public void tearDownMethod() throws Exception {
163: super.tearDownMethod();
164: }
165:
166: }
|