001: /**
002: * EasyBeans
003: * Copyright (C) 2006 Bull S.A.S.
004: * Contact: easybeans@ow2.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * --------------------------------------------------------------------------
022: * $Id: TestResourceRefXMLInjection.java 1970 2007-10-16 11:49:25Z benoitf $
023: * --------------------------------------------------------------------------
024: */package org.ow2.easybeans.tests.environment.reference.resource;
025:
026: import static org.ow2.easybeans.tests.common.helper.EJBHelper.getBeanRemoteInstance;
027:
028: import org.ow2.easybeans.tests.common.ejbs.base.ItfCheck00;
029: import org.ow2.easybeans.tests.common.ejbs.base.ItfResourceEnvRef00;
030: import org.ow2.easybeans.tests.common.ejbs.stateless.beanmanaged.usertxref.SLSBBeanManagedUtxRefXML00;
031: import org.ow2.easybeans.tests.common.ejbs.stateless.containermanaged.resourceref.SLSBResourceRefXMLInjection00;
032: import org.ow2.easybeans.tests.common.ejbs.stateless.containermanaged.timersrvref.SLSBTimerSrvRefXML00;
033: import org.testng.annotations.BeforeClass;
034: import org.testng.annotations.BeforeMethod;
035: import org.testng.annotations.Test;
036:
037: /**
038: * Verifies if the resource injection using xml descriptors is following the JSR 220.
039: * The items covered in this test are: 16.7, 16.12, 16.14, 16.15 and 16.19.
040: * @reference JSR 220 - EJB 3.0 Core
041: * @requirement Application Server must be running; the bean
042: * org.ow2.easybeans.tests.common.ejbs.stateless.containermanaged.resourcereference.*
043: * must be deployed.
044: * @setup gets the reference of the bean
045: * @author Eduardo Studzinski Estima de Castro
046: * @author Gisele Pinheiro Souza
047: *
048: */
049: public class TestResourceRefXMLInjection {
050:
051: /**
052: * Bean used in tests.
053: */
054: private ItfResourceEnvRef00 bean;
055:
056: /**
057: * Bean used in timer service tests.
058: */
059: private ItfCheck00 timerBean;
060:
061: /**
062: * Bean used in user transaction tests.
063: */
064: private ItfCheck00 utxBean;
065:
066: /**
067: * Gets bean instances used in the tests.
068: * @throws Exception if there is a problem with the bean initialization.
069: */
070: @BeforeMethod
071: public void startUp() throws Exception {
072: bean = getBeanRemoteInstance(
073: SLSBResourceRefXMLInjection00.class,
074: ItfResourceEnvRef00.class);
075: }
076:
077: /**
078: * Gets bean instances used in the tests.
079: * @throws Exception if there is a problem with the bean initialization.
080: */
081: @BeforeClass
082: public void startUp01() throws Exception {
083: timerBean = getBeanRemoteInstance(SLSBTimerSrvRefXML00.class,
084: ItfCheck00.class);
085: utxBean = getBeanRemoteInstance(
086: SLSBBeanManagedUtxRefXML00.class, ItfCheck00.class);
087: }
088:
089: /**
090: * Tests if a resource is injected using a xml descriptor.
091: * @input -
092: * @output -
093: */
094: @Test
095: public void testJDBC00() {
096: bean.checkJDBC();
097: }
098:
099: /**
100: * Tests if a resource is injected using a xml descriptor.
101: * @input -
102: * @output -
103: */
104: @Test
105: public void testJMS00() {
106: bean.checkJMSConFactory();
107: }
108:
109: /**
110: * Tests if a resource is injected using a xml descriptor.
111: * @input -
112: * @output -
113: */
114: @Test
115: public void testJMS01() {
116: bean.checkJMSQueueConFactory();
117: }
118:
119: /**
120: * Tests if a resource is injected using a xml descriptor.
121: * @input -
122: * @output -
123: */
124: @Test
125: public void testJMSQueue() {
126: bean.checkJMSQueue();
127: }
128:
129: /**
130: * Tests if a resource is injected using a xml descriptor.
131: * @input -
132: * @output -
133: */
134: @Test
135: public void testJMSTopic() {
136: bean.checkJMSTopic();
137: }
138:
139: /**
140: * Tests if a resource is injected using a xml descriptor.
141: * @input -
142: * @output -
143: */
144: @Test
145: public void testJMS02() {
146: bean.checkJMSTopicConFactory();
147: }
148:
149: /**
150: * Tests if a resource is injected using a xml descriptor.
151: * @input -
152: * @output -
153: */
154: @Test
155: public void testMail00() {
156: bean.checkMailSession();
157: }
158:
159: /**
160: * Tests if a resource is injected using a xml descriptor.
161: * @input -
162: * @output -
163: */
164: @Test
165: public void testUrl00() {
166: bean.checkUrl();
167: }
168:
169: /**
170: * Tests if a resource is injected using a xml descriptor.
171: * @input -
172: * @output -
173: */
174: @Test
175: public void testEJBContext00() {
176: bean.checkEJBContext();
177: }
178:
179: /**
180: * Tests if a resource is injected using a xml descriptor.
181: * @input -
182: * @output -
183: */
184: @Test
185: public void testTimerService00() {
186: timerBean.check();
187: }
188:
189: /**
190: * Tests if a resource is injected using a xml descriptor.
191: * @input -
192: * @output -
193: */
194: @Test
195: public void testUserTransaction00() {
196: utxBean.check();
197: }
198: }
|