KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > tests > interceptors > business > stateless > beanmanaged > TestSLBeanManagedAccessInterceptor00


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: TestSLBeanManagedAccessInterceptor00.java 978 2006-07-28 13:19:14Z studzine $
23  * --------------------------------------------------------------------------
24  */

25 package org.objectweb.easybeans.tests.interceptors.business.stateless.beanmanaged;
26
27 import static org.objectweb.easybeans.tests.common.helper.EJBHelper.getBeanRemoteInstance;
28
29 import org.objectweb.easybeans.tests.common.ejbs.base.ItfAccessEJB;
30 import org.objectweb.easybeans.tests.common.ejbs.base.ItfAccessEMFactory;
31 import org.objectweb.easybeans.tests.common.ejbs.base.ItfAccessEntityManager;
32 import org.objectweb.easybeans.tests.common.ejbs.base.ItfAccessJNDI;
33 import org.objectweb.easybeans.tests.common.ejbs.base.ItfAccessResourceManager;
34 import org.objectweb.easybeans.tests.common.ejbs.base.ItfAccessSessionContext;
35 import org.objectweb.easybeans.tests.common.ejbs.base.ItfAccessUserTransaction;
36 import org.objectweb.easybeans.tests.common.ejbs.stateless.beanmanaged.interceptoraccess.SLSBBMTAccessSessionCtxInterceptor00;
37 import org.objectweb.easybeans.tests.common.ejbs.stateless.beanmanaged.interceptoraccess.SLSBBMTAccessSessionCtxInterceptor01;
38 import org.objectweb.easybeans.tests.common.ejbs.stateless.beanmanaged.interceptoraccess.SLSBBMTAccessUserTxInterceptor00;
39 import org.objectweb.easybeans.tests.common.ejbs.stateless.beanmanaged.interceptoraccess.SLSBBeanManagedAccessInterceptorTest00;
40 import org.objectweb.easybeans.tests.interceptors.business.base.access.BaseAccessOperationsInterceptor00;
41 import org.testng.annotations.BeforeClass;
42 import org.testng.annotations.Test;
43
44 /**
45  * Verifies if interceptors in an external class can perform the
46  * operations specified by the JSR-220.
47  * @reference JSR 220 - EJB 3.0 Core - 4.5.2
48  * @requirement Application Server must be running; the beans
49  * org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.SSLSBBeanManagedAccess*InterceptorTest00
50  * must be deployed.
51  * (Ant task: install.jar.tests.interceptor.business)
52  * @setup gets the reference of SLSBBeanManagedAccess*Test00
53  * @author Eduardo Studzinski Estima de Castro
54  * @author Gisele Pinheiro Souza
55  */

56 public class TestSLBeanManagedAccessInterceptor00 extends BaseAccessOperationsInterceptor00 {
57
58     /**
59      * Gets bean instances used in the tests.
60      * @throws Exception if there is a problem with the bean initialization.
61      */

62     @BeforeClass
63     public void startUp() throws Exception JavaDoc {
64         ItfAccessJNDI bean00 = getBeanRemoteInstance(SLSBBeanManagedAccessInterceptorTest00.class, ItfAccessJNDI.class);
65         ItfAccessEJB bean01 = getBeanRemoteInstance(SLSBBeanManagedAccessInterceptorTest00.class, ItfAccessEJB.class);
66         ItfAccessResourceManager bean02 = getBeanRemoteInstance(SLSBBeanManagedAccessInterceptorTest00.class,
67                 ItfAccessResourceManager.class);
68         ItfAccessEntityManager bean03 = getBeanRemoteInstance(SLSBBeanManagedAccessInterceptorTest00.class,
69                 ItfAccessEntityManager.class);
70         ItfAccessEMFactory bean04 = getBeanRemoteInstance(SLSBBeanManagedAccessInterceptorTest00.class,
71                 ItfAccessEMFactory.class);
72         ItfAccessSessionContext bean05 = getBeanRemoteInstance(SLSBBeanManagedAccessInterceptorTest00.class,
73                 ItfAccessSessionContext.class);
74         ItfAccessUserTransaction bean06 = getBeanRemoteInstance(
75                 SLSBBMTAccessUserTxInterceptor00.class, ItfAccessUserTransaction.class);
76
77         ItfAccessSessionContext bean07 = getBeanRemoteInstance(
78                 SLSBBMTAccessSessionCtxInterceptor00.class, ItfAccessSessionContext.class);
79         ItfAccessSessionContext bean08 = getBeanRemoteInstance(
80                 SLSBBMTAccessSessionCtxInterceptor01.class, ItfAccessSessionContext.class);
81         super.setBeans(bean00, bean01, bean02, bean03, bean04, bean05, bean06, bean07, bean08);
82     }
83
84     /**
85      * Verifies if the interceptor can access the "java:comp/env" via JNDI. This
86      * operation is allowed, so there isn't an expected
87      * exception.
88      * @input -
89      * @output no exceptions.
90      * @throws Exception if a problem occurs.
91      */

92     @Override JavaDoc
93     @Test(groups = {"java:comp/env access"})
94     public void testJNDI00() throws Exception JavaDoc {
95         super.testJNDI00();
96     }
97
98     /**
99      * Verifies if the interceptor can access an EJB. This
100      * operation is allowed, so there isn't an expected
101      * exception.
102      * @input -
103      * @output no exceptions.
104      * @throws Exception if a problem occurs.
105      */

106     @Override JavaDoc
107     @Test(groups = {"EJB access"})
108     public void testEJB00() throws Exception JavaDoc {
109         super.testEJB00();
110     }
111
112     /**
113      * Verifies if the interceptor can access the resource manager. This
114      * operation is allowed, so there isn't an expected
115      * exception.
116      * @input -
117      * @output no exceptions.
118      * @throws Exception if a problem occurs.
119      */

120     @Override JavaDoc
121     @Test(groups = {"Resource access"})
122     public void testResource00() throws Exception JavaDoc {
123         super.testResource00();
124     }
125
126     /**
127      * Verifies if the interceptor can access the entity manager. This
128      * operation is allowed, so there isn't an expected
129      * exception.
130      * @input -
131      * @output no exceptions.
132      * @throws Exception if a problem occurs.
133      */

134     @Override JavaDoc
135     @Test(groups = {"Entity Manager access"})
136     public void testEntityManager00() throws Exception JavaDoc {
137         super.testEntityManager00();
138     }
139
140     /**
141      * Verifies if the interceptor can access the entity factory. This
142      * operation is allowed, so there isn't an expected
143      * exception.
144      * @input -
145      * @output no exceptions.
146      * @throws Exception if a problem occurs.
147      */

148     @Override JavaDoc
149     @Test(groups = {"Entity Factory access"})
150     public void testEntityFactory00() throws Exception JavaDoc {
151         super.testEntityFactory00();
152     }
153
154     /**
155      * Verifies if the interceptor can access the session context. This
156      * operation is allowed, so there isn't an expected
157      * exception.
158      * @input -
159      * @output no exceptions.
160      * @throws Exception if a problem occurs.
161      */

162     @Override JavaDoc
163     @Test(groups = {"SessionContext access"})
164     public void testSessionContext00() throws Exception JavaDoc {
165         super.testSessionContext00();
166     }
167
168     /**
169      * Verifies if an interceptor can access the "getTimerService()" of a
170      * SessionContext instance. This
171      * operation is allowed, so there isn't an expected
172      * exception.
173      * @input -
174      * @output No exceptions.
175      * @throws Exception if a problem occurs.
176      */

177     @Override JavaDoc
178     @Test(groups = {"SessionContext access"})
179     public void testSessionContext01() throws Exception JavaDoc {
180         super.testSessionContext01();
181     }
182
183     /**
184      * Test if an interceptor can access the "getUserTransaction()" of a
185      * SessionContext instance. This
186      * operation is allowed, so there isn't an expected
187      * exception.
188      * @input -
189      * @output No exceptions.
190      * @throws Exception if a problem occurs.
191      */

192     @Override JavaDoc
193     @Test(groups = {"SessionContext access"})
194     public void testSessionContext02() throws Exception JavaDoc {
195         super.testSessionContext02();
196     }
197
198     /**
199      * Verifies if the interceptor can access the user transaction. This
200      * operation is allowed, so there isn't an expected
201      * exception.
202      * @input -
203      * @output no exceptions.
204      * @throws Exception if a problem occurs.
205      */

206     @Override JavaDoc
207     @Test(groups = {"UserTransaction access"})
208     public void testUserTransaction00() throws Exception JavaDoc {
209         super.testUserTransaction00();
210     }
211
212 }
213
Popular Tags