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: TestEJBRefMethodInjection.java 1970 2007-10-16 11:49:25Z benoitf $
023: * --------------------------------------------------------------------------
024: */package org.ow2.easybeans.tests.environment.reference.ejb;
025:
026: import static org.ow2.easybeans.tests.common.helper.EJBHelper.getBeanRemoteInstance;
027:
028: import org.ow2.easybeans.tests.common.ejbs.base.ItfEJBRef;
029: import org.ow2.easybeans.tests.common.ejbs.stateless.containermanaged.ejbref.SLSBEjbRefMethodInjection;
030: import org.testng.annotations.BeforeMethod;
031: import org.testng.annotations.Test;
032:
033: /**
034: * Verifies if the ejb references injection using setXXX() method is following the JSR 220.
035: * @reference JSR 220 - EJB 3.0 Core - 16.5
036: * @requirement Application Server must be running; the bean
037: * org.ow2.easybeans.tests.common.ejbs.stateless.containermanaged.ejbreference.*
038: * must be deployed.
039: * @setup gets the reference of the bean
040: * @author Eduardo Studzinski Estima de Castro
041: * @author Gisele Pinheiro Souza
042: */
043: public class TestEJBRefMethodInjection {
044:
045: /**
046: * Bean used in tests.
047: */
048: private ItfEJBRef bean;
049:
050: /**
051: * Gets bean instances used in the tests.
052: * @throws Exception if there is a problem with the bean initialization.
053: */
054: @BeforeMethod
055: public void startUp() throws Exception {
056: bean = getBeanRemoteInstance(SLSBEjbRefMethodInjection.class,
057: ItfEJBRef.class);
058: }
059:
060: /**
061: * Checks if the annotation @EJB is working properly. The annotation's
062: * properties are not used.
063: */
064: @Test
065: public void test00() {
066: bean.check00();
067: }
068:
069: /**
070: * Checks if the annotation @EJB is working properly. The following
071: * properties are used: <li>name</li><li>description</li>
072: */
073: @Test
074: public void test01() {
075: bean.check01();
076: }
077:
078: /**
079: * Checks if the annotation @EJB is working properly. The following
080: * property is used: <li>beanInterface</li>
081: */
082: @Test
083: public void test02() {
084: bean.check02();
085: }
086:
087: /**
088: * Checks if the annotation @EJB is working properly. The following
089: * property is used: <li>beanName</li>
090: */
091: @Test
092: public void test03() {
093: bean.check03();
094: }
095:
096: /**
097: * Checks if the annotation @EJB is working properly. The following
098: * property is used: <li>mappedName</li>
099: */
100: @Test
101: public void test04() {
102: bean.check04();
103: }
104:
105: /**
106: * Checks if the annotation @EJB is working properly. The following
107: * properties are used: <li>name</li> <li>beanInterface</li><li>beanName</li><li>description</li>
108: */
109: @Test
110: public void test05() {
111: bean.check05();
112: }
113:
114: /**
115: * Checks if the annotation @EJB is working properly. The following
116: * properties are used: <li>name</li> <li>beanInterface</li><li>beanName</li><li>description</li><li>mappedName</li>
117: */
118: @Test
119: public void test06() {
120: bean.check06();
121: }
122:
123: }
|