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: TestSLTimeoutAccess.java 1970 2007-10-16 11:49:25Z benoitf $
023: * --------------------------------------------------------------------------
024: */package org.ow2.easybeans.tests.timerservice.timeout.stateless.containermanaged;
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.containermanaged.timer.SLSBTimeoutCallbackAccess00;
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 TestSLTimeoutAccess 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(SLSBTimeoutCallbackAccess00.class,
069: ItfCreateTimer.class);
070: }
071:
072: /**
073: * Gets the name of the bean where the timer was started.
074: * @return name
075: */
076: @Override
077: public String getBeanName() {
078: return SLSBTimeoutCallbackAccess00.class.getName();
079: }
080:
081: /**
082: * Starts the timer.
083: * @param type operation type
084: */
085: @Override
086: public void requestStartTimer(final OperationType type) {
087: bean.startTimer(ItfCreateTimer.DURATION, type);
088: }
089:
090: /**
091: * Tests if a timeout callback method is allowed to access an EJB.
092: * @throws Exception if a problem occurs.
093: */
094: @Override
095: @Test
096: public void testAccessEJB00() throws Exception {
097: super .testAccessEJB00();
098: }
099:
100: /**
101: * Tests if a timeout callback method is allowed to access the Resource
102: * Manager.
103: * @throws Exception if a problem occurs.
104: */
105: @Override
106: @Test
107: public void testAccessResourceManager00() throws Exception {
108: super .testAccessResourceManager00();
109: }
110:
111: /**
112: * Tests if a timeout callback method is allowed to access the Entity
113: * Manager.
114: * @throws Exception if a problem occurs.
115: */
116: @Override
117: @Test
118: public void testAccessEntityManager00() throws Exception {
119: super .testAccessEntityManager00();
120: }
121:
122: /**
123: * Tests if a timeout callback method is allowed to access the Entity
124: * Manager Factory.
125: * @throws Exception if a problem occurs.
126: */
127: @Override
128: @Test
129: public void testAccessEntityManagerFactory00() throws Exception {
130: super .testAccessEntityManagerFactory00();
131: }
132:
133: /**
134: * Tests if a timeout callback method is allowed to access the Timer
135: * Service.
136: * @throws Exception if a problem occurs.
137: */
138: @Override
139: @Test
140: public void testAccessTimerService00() throws Exception {
141: super .testAccessTimerService00();
142: }
143:
144: /**
145: * Tests if a timeout callback method is allowed to access the
146: * UserTransaction.
147: * @throws Exception if a problem occurs.
148: */
149: @Override
150: @Test
151: public void testAccessUserTransaction00() throws Exception {
152: super .testAccessUserTransaction00();
153: }
154:
155: /**
156: * Clears logs.
157: * @throws Exception if a problem occurs.
158: */
159: @Override
160: @AfterMethod
161: public void tearDownMethod() throws Exception {
162: super.tearDownMethod();
163: }
164:
165: }
|