KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > tests > environment > reference > resource > TestResourceRefXMLInjection


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: TestResourceRefXMLInjection.java 990 2006-07-31 13:09:09Z studzine $
23  * --------------------------------------------------------------------------
24  */

25 package org.objectweb.easybeans.tests.environment.reference.resource;
26
27 import static org.objectweb.easybeans.tests.common.helper.EJBHelper.getBeanRemoteInstance;
28
29 import org.objectweb.easybeans.tests.common.ejbs.base.ItfCheck00;
30 import org.objectweb.easybeans.tests.common.ejbs.base.ItfResourceEnvRef00;
31 import org.objectweb.easybeans.tests.common.ejbs.stateless.beanmanaged.usertxref.SLSBBeanManagedUtxRefXML00;
32 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.resourceref.SLSBResourceRefXMLInjection00;
33 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.timersrvref.SLSBTimerSrvRefXML00;
34 import org.testng.annotations.BeforeClass;
35 import org.testng.annotations.BeforeMethod;
36 import org.testng.annotations.Test;
37
38 /**
39  * Verifies if the resource injection using xml descriptors is following the JSR 220.
40  * The items covered in this test are: 16.7, 16.12, 16.14, 16.15 and 16.19.
41  * @reference JSR 220 - EJB 3.0 Core
42  * @requirement Application Server must be running; the bean
43  * org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.resourcereference.*
44  * must be deployed.
45  * @setup gets the reference of the bean
46  * @author Eduardo Studzinski Estima de Castro
47  * @author Gisele Pinheiro Souza
48  *
49  */

50 public class TestResourceRefXMLInjection {
51
52     /**
53      * Bean used in tests.
54      */

55     private ItfResourceEnvRef00 bean;
56
57     /**
58      * Bean used in timer service tests.
59      */

60     private ItfCheck00 timerBean;
61
62     /**
63      * Bean used in user transaction tests.
64      */

65     private ItfCheck00 utxBean;
66
67     /**
68      * Gets bean instances used in the tests.
69      * @throws Exception if there is a problem with the bean initialization.
70      */

71     @BeforeMethod
72     public void startUp() throws Exception JavaDoc {
73         bean = getBeanRemoteInstance(SLSBResourceRefXMLInjection00.class, ItfResourceEnvRef00.class);
74     }
75
76     /**
77      * Gets bean instances used in the tests.
78      * @throws Exception if there is a problem with the bean initialization.
79      */

80     @BeforeClass
81     public void startUp01() throws Exception JavaDoc {
82         timerBean = getBeanRemoteInstance(SLSBTimerSrvRefXML00.class, ItfCheck00.class);
83         utxBean = getBeanRemoteInstance(SLSBBeanManagedUtxRefXML00.class, ItfCheck00.class);
84     }
85
86     /**
87      * Tests if a resource is injected using a xml descriptor.
88      * @input -
89      * @output -
90      */

91     @Test
92     public void testJDBC00(){
93         bean.checkJDBC();
94     }
95
96     /**
97      * Tests if a resource is injected using a xml descriptor.
98      * @input -
99      * @output -
100      */

101     @Test
102     public void testJMS00(){
103         bean.checkJMSConFactory();
104     }
105
106     /**
107      * Tests if a resource is injected using a xml descriptor.
108      * @input -
109      * @output -
110      */

111     @Test
112     public void testJMS01(){
113         bean.checkJMSQueueConFactory();
114     }
115
116     /**
117      * Tests if a resource is injected using a xml descriptor.
118      * @input -
119      * @output -
120      */

121     @Test
122     public void testJMSQueue(){
123         bean.checkJMSQueue();
124     }
125     /**
126      * Tests if a resource is injected using a xml descriptor.
127      * @input -
128      * @output -
129      */

130     @Test
131     public void testJMSTopic(){
132         bean.checkJMSTopic();
133     }
134
135     /**
136      * Tests if a resource is injected using a xml descriptor.
137      * @input -
138      * @output -
139      */

140     @Test
141     public void testJMS02(){
142         bean.checkJMSTopicConFactory();
143     }
144
145     /**
146      * Tests if a resource is injected using a xml descriptor.
147      * @input -
148      * @output -
149      */

150     @Test
151     public void testMail00(){
152         bean.checkMailSession();
153     }
154
155     /**
156      * Tests if a resource is injected using a xml descriptor.
157      * @input -
158      * @output -
159      */

160     @Test
161     public void testUrl00(){
162         bean.checkUrl();
163     }
164
165     /**
166      * Tests if a resource is injected using a xml descriptor.
167      * @input -
168      * @output -
169      */

170     @Test
171     public void testEJBContext00(){
172         bean.checkEJBContext();
173     }
174
175     /**
176      * Tests if a resource is injected using a xml descriptor.
177      * @input -
178      * @output -
179      */

180     @Test
181     public void testTimerService00(){
182         timerBean.check();
183     }
184
185     /**
186      * Tests if a resource is injected using a xml descriptor.
187      * @input -
188      * @output -
189      */

190     @Test
191     public void testUserTransaction00(){
192         utxBean.check();
193     }
194 }
195
Popular Tags