KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > tests > interceptors > business > stateful > beanmanaged > TestSFBeanManagedAccessInterceptor01


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

25 package org.objectweb.easybeans.tests.interceptors.business.stateful.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.stateful.beanmanaged.interceptoraccess.SFSBBMTAccessUserTxInterceptor00;
37 import org.objectweb.easybeans.tests.common.ejbs.stateful.beanmanaged.interceptoraccess.SFSBBeanManagedAccessInterceptorTest00;
38 import org.objectweb.easybeans.tests.common.ejbs.stateful.beanmanaged.interceptoraccess.SFSBBeanManagedAccessInterceptorTest01;
39 import org.objectweb.easybeans.tests.interceptors.business.base.access.BaseAccessOperationsInterceptor00;
40 import org.testng.annotations.BeforeClass;
41 import org.testng.annotations.Test;
42
43
44 /**
45  * Verifies if interceptors in the bean class can access the perform the operations specified by the JSR-220.
46  * @reference JSR 220 - EJB 3.0 Core - 4.4.1
47  * @requirement Application Server must be running; the beans
48  * org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.SFSB*AccessInterceptor*
49  * must be deployed.
50  * (Ant task: install.jar.tests.interceptor.business)
51  * @setup gets the reference of SFSBAccessInterceptorTest01
52  * @author Eduardo Studzinski Estima de Castro
53  * @author Gisele Pinheiro Souza
54  */

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

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

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

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

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

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

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

156     @Override JavaDoc
157     @Test(groups = {"SessionContext access"})
158     public void testSessionContext00() throws Exception JavaDoc {
159         super.testSessionContext00();
160     }
161
162     /**
163      * Verifies if the interceptor can access the user transaction. This
164      * operation is allowed, so there isn't an expected
165      * exception.
166      * @input -
167      * @output no exceptions.
168      * @throws Exception if a problem occurs.
169      */

170     @Override JavaDoc
171     @Test(groups = {"UserTransaction access"})
172     public void testUserTransaction00() throws Exception JavaDoc {
173         super.testUserTransaction00();
174     }
175
176 }
177
Popular Tags