KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > tests > interceptors > business > base > access > BaseAccessOperationsInterceptor00


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: BaseAccessOperationsInterceptor00.java 821 2006-07-04 13:28:52Z studzine $
23  * --------------------------------------------------------------------------
24  */

25 package org.objectweb.easybeans.tests.interceptors.business.base.access;
26
27 import org.objectweb.easybeans.tests.common.ejbs.base.ItfAccessEJB;
28 import org.objectweb.easybeans.tests.common.ejbs.base.ItfAccessEMFactory;
29 import org.objectweb.easybeans.tests.common.ejbs.base.ItfAccessEntityManager;
30 import org.objectweb.easybeans.tests.common.ejbs.base.ItfAccessJNDI;
31 import org.objectweb.easybeans.tests.common.ejbs.base.ItfAccessResourceManager;
32 import org.objectweb.easybeans.tests.common.ejbs.base.ItfAccessSessionContext;
33 import org.objectweb.easybeans.tests.common.ejbs.base.ItfAccessUserTransaction;
34
35 /**
36  * Verifies the interceptor access to the following items. <li>SessionContext
37  * Methods</li> <li>JNDI Access to java:comp/env</li> <li>Resource Manager</li>
38  * <li>Enterprise bean</li> <li>EntityManagerFactory</li> <li>EntityManager</li>
39  * <li>TimerService</li> <li>UserTransaction</li>
40  * @author Eduardo Studzinski Estima de Castro
41  * @author Gisele Pinheiro Souza
42  */

43 public class BaseAccessOperationsInterceptor00 {
44
45     /**
46      * Bean used to implement the test.
47      */

48     private ItfAccessJNDI beanAccessJNDI;
49
50     /**
51      * Bean used to implement the test.
52      */

53     private ItfAccessEJB beanAccessEJB;
54
55     /**
56      * Bean used to implement the test.
57      */

58     private ItfAccessResourceManager beanAccessResourceManager;
59
60     /**
61      * Bean used to implement the test.
62      */

63     private ItfAccessEntityManager beanAccessEntityManager;
64
65     /**
66      * Bean used to implement the test.
67      */

68     private ItfAccessEMFactory beanAccessEMFactory;
69
70     /**
71      * Bean used to implement the test.
72      */

73     private ItfAccessSessionContext beanAccessSessionContext01;
74
75     /**
76      * Bean used to implement the test.
77      */

78     private ItfAccessUserTransaction beanAcessUserTransaction;
79
80     /**
81      * Bean used to implement the test.
82      */

83     private ItfAccessSessionContext beanAccessSessionContext00;
84
85     /**
86      * Bean used to implement the test.
87      */

88     private ItfAccessSessionContext beanAccessSessionContext02;
89
90     /**
91      * Verifies if the interceptor can access the "java:comp/env" via JNDI.
92      * @throws Exception if a problem occurs.
93      */

94     @SuppressWarnings JavaDoc("unchecked")
95     public void testJNDI00() throws Exception JavaDoc {
96         beanAccessJNDI.accessJNDI(null);
97     }
98
99     /**
100      * Verifies if the interceptor can access an ejb.
101      * @throws Exception if a problem occurs.
102      */

103     @SuppressWarnings JavaDoc("unchecked")
104     public void testEJB00() throws Exception JavaDoc {
105         beanAccessEJB.accessEJB(null);
106     }
107
108     /**
109      * Verifies if the interceptor can access a resource.
110      * @throws Exception if a problem occurs.
111      */

112     @SuppressWarnings JavaDoc("unchecked")
113     public void testResource00() throws Exception JavaDoc {
114         beanAccessResourceManager.accessResManager(null);
115     }
116
117     /**
118      * Verifies if the interceptor can access an Entity Manager.
119      * @throws Exception if a problem occurs.
120      */

121     @SuppressWarnings JavaDoc("unchecked")
122     public void testEntityManager00() throws Exception JavaDoc {
123         beanAccessEntityManager.accessEntityManager(null);
124     }
125
126     /**
127      * Verifies if the interceptor can access an Entity Factory.
128      * @throws Exception if a problem occurs.
129      */

130     @SuppressWarnings JavaDoc("unchecked")
131     public void testEntityFactory00() throws Exception JavaDoc {
132         beanAccessEMFactory.accessEntityManagerFactory(null);
133     }
134
135     /**
136      * Verifies if the interceptor can access a SessionContext.
137      * @throws Exception if a problem occurs.
138      */

139     @SuppressWarnings JavaDoc("unchecked")
140     public void testSessionContext00() throws Exception JavaDoc {
141         beanAccessSessionContext01.accessSessionContext(null);
142     }
143
144     /**
145      * Verifies if the interceptor can access an UserTransaction.
146      * @throws Exception if a problem occurs.
147      */

148     @SuppressWarnings JavaDoc("unchecked")
149     public void testUserTransaction00() throws Exception JavaDoc {
150         beanAcessUserTransaction.accessUserTransaction(null);
151     }
152
153     /**
154      * Verifies if the interceptor can call the "getTimerService()" of a
155      * SessionContext.
156      * @throws Exception if a problem occurs.
157      */

158     @SuppressWarnings JavaDoc("unchecked")
159     public void testSessionContext01() throws Exception JavaDoc {
160         beanAccessSessionContext00.accessSessionContext(null);
161     }
162
163     /**
164      * Verifies if the interceptor can call "getUserTransaction()" of a
165      * SessionContext.
166      * @throws Exception if a problem occurs.
167      */

168     @SuppressWarnings JavaDoc("unchecked")
169     public void testSessionContext02() throws Exception JavaDoc {
170         beanAccessSessionContext02.accessSessionContext(null);
171     }
172
173     /**
174      * Sets bean(s) used in the tests.
175      * @param bean00 The bean to set.
176      * @param bean01 The bean to set.
177      * @param bean02 The bean to set.
178      * @param bean03 The bean to set.
179      * @param bean04 The bean to set.
180      * @param bean05 The bean to set.
181      * @param bean06 The bean to set.
182      */

183     public void setBeans(final ItfAccessJNDI bean00, final ItfAccessEJB bean01, final ItfAccessResourceManager bean02,
184             final ItfAccessEntityManager bean03, final ItfAccessEMFactory bean04, final ItfAccessSessionContext bean05,
185             final ItfAccessUserTransaction bean06) {
186         this.beanAccessJNDI = bean00;
187         this.beanAccessEJB = bean01;
188         this.beanAccessResourceManager = bean02;
189         this.beanAccessEntityManager = bean03;
190         this.beanAccessEMFactory = bean04;
191         this.beanAccessSessionContext01 = bean05;
192         this.beanAcessUserTransaction = bean06;
193     }
194
195     /**
196      * Sets bean(s) used in the tests.
197      * @param bean00 The bean to set.
198      * @param bean01 The bean to set.
199      * @param bean02 The bean to set.
200      * @param bean03 The bean to set.
201      * @param bean04 The bean to set.
202      * @param bean05 The bean to set.
203      * @param bean06 The bean to set.
204      * @param bean07 The bean to set.
205      * @param bean08 The bean to set.
206      */

207     public void setBeans(final ItfAccessJNDI bean00, final ItfAccessEJB bean01, final ItfAccessResourceManager bean02,
208             final ItfAccessEntityManager bean03, final ItfAccessEMFactory bean04, final ItfAccessSessionContext bean05,
209             final ItfAccessUserTransaction bean06,
210             final ItfAccessSessionContext bean07, final ItfAccessSessionContext bean08) {
211         this.setBeans(bean00, bean01, bean02, bean03, bean04, bean05, bean06);
212         this.beanAccessSessionContext00 = bean07;
213         this.beanAccessSessionContext02 = bean08;
214     }
215
216 }
217
Popular Tags