KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > tests > deploymentdesc > TestInterceptor03


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: TestInterceptor03.java 977 2006-07-28 13:18:26Z studzine $
23  * --------------------------------------------------------------------------
24  */

25 package org.objectweb.easybeans.tests.deploymentdesc;
26
27 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.interceptorxml.ItfIntercResourceRef;
28 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.interceptorxml.SLSBIntercResourceRef;
29 import org.objectweb.easybeans.tests.common.helper.EJBHelper;
30 import org.testng.annotations.BeforeMethod;
31 import org.testng.annotations.Test;
32
33 /**
34  * Verifies if the container inject resources for an interceptor qhen the resources are define in the deployment descriptor.
35  * @reference JSR 220 - FINAL RELEASE
36  * @requirement the bean SLSBIntercResourceRef must be deployed to make the tests,
37  * and, the deployment descriptors must be used too.
38  * @setup gets an instance of the SLSBIntercResourceRef.
39  * @author Gisele Pinheiro Souza
40  * @author Eduardo Studzinski Estima de Castro
41  */

42 public class TestInterceptor03 {
43
44     /**
45      * Bean used to verify the interceptor definition..
46      */

47     private ItfIntercResourceRef bean;
48
49     /**
50      * Creates the beans used during the tests.
51      * @throws Exception if an error occurs during the lookup.
52      */

53     @BeforeMethod
54     public void setup() throws Exception JavaDoc {
55         bean = EJBHelper.getBeanRemoteInstance(SLSBIntercResourceRef.class, ItfIntercResourceRef.class);
56     }
57
58     /**
59      * Verifies if a datasource is injected in an interceptor when it is
60      * described in the deployment descriptor.
61      * @input -
62      * @output the correct method execution.
63      */

64     @Test
65     public void verifiesDataSource(){
66         bean.checkJDBC();
67     }
68
69     /**
70      * Verifies if a queue connection factory is injected in an interceptor when it is
71      * described in the deployment descriptor.
72      * @input -
73      * @output the correct method execution.
74      */

75     @Test
76     public void verifiesJMSQueue(){
77         bean.checkJMSQueueConFactory();
78     }
79
80     /**
81      * Verifies if a connection factory is injected in an interceptor when it is
82      * described in the deployment descriptor.
83      * @input -
84      * @output the correct method execution.
85      */

86     @Test
87     public void verifiesJMSConFactory(){
88         bean.checkJMSConFactory();
89     }
90
91     /**
92      * Verifies if a topic connection factory is injected in an interceptor when it is
93      * described in the deployment descriptor.
94      * @input -
95      * @output the correct method execution.
96      */

97     @Test
98     public void verifiesTopicConFactory(){
99         bean.checkJMSTopicConFactory();
100     }
101
102     /**
103      * Verifies if the EJBContext connection factory is injected in an interceptor when it is
104      * described in the deployment descriptor.
105      * @input -
106      * @output the correct method execution.
107      */

108     @Test
109     public void verifiesEJBContext(){
110         bean.checkEJBContext();
111     }
112
113     /**
114      * Verifies if a mail session is injected in an interceptor when it is
115      * described in the deployment descriptor.
116      * @input -
117      * @output the correct method execution.
118      */

119     @Test
120     public void verifiesMailSession(){
121         bean.checkMailSession();
122     }
123
124     /**
125      * Verifies if an URL is injected in an interceptor when it is
126      * described in the deployment descriptor.
127      * @input -
128      * @output the correct method execution.
129      */

130     @Test
131     public void verifiesURL(){
132         bean.checkUrl();
133     }
134 }
135
Popular Tags