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: TestSimpleEnvironmentEntryFieldInjection.java 1970 2007-10-16 11:49:25Z benoitf $
023: * --------------------------------------------------------------------------
024: */package org.ow2.easybeans.tests.environment.reference.simpleentry;
025:
026: import static org.ow2.easybeans.tests.common.helper.EJBHelper.getBeanRemoteInstance;
027:
028: import org.ow2.easybeans.tests.common.ejbs.base.ItfSimpleEnvEntry;
029: import org.ow2.easybeans.tests.common.ejbs.base.ItfSimpleEnvEntryByDescriptor;
030: import org.ow2.easybeans.tests.common.ejbs.stateless.containermanaged.simpleentry.SLSBSimpleEnvEntryByDescriptor;
031: import org.ow2.easybeans.tests.common.ejbs.stateless.containermanaged.simpleentry.SLSBSimpleEnvEntryFieldInjection00;
032: import org.testng.annotations.BeforeMethod;
033: import org.testng.annotations.Test;
034:
035: /**
036: * Verifies if the simple environment entries injection is following the JSR 220.
037: * The items covered in this test are: 16.4
038: * @reference JSR 220-PROPOSED FINAL
039: * @requirement Application Server must be running; the bean
040: * org.ow2.easybeans.tests.common.ejbs.stateless.containermanaged.simpleentry.*
041: * must be deployed. (Ant task: install.jar.tests.simple.environment.session)
042: * @setup gets the reference of the bean
043: * @author Eduardo Studzinski Estima de Castro
044: * @author Gisele Pinheiro Souza
045: */
046: public class TestSimpleEnvironmentEntryFieldInjection {
047:
048: /**
049: * Bean used in tests.
050: */
051: private ItfSimpleEnvEntry bean;
052:
053: /**
054: * Bean used in tests.
055: */
056: private ItfSimpleEnvEntryByDescriptor beanInjectionByDescriptor;
057:
058: /**
059: * Gets bean instances used in the tests.
060: * @throws Exception if there is a problem with the bean initialization.
061: */
062: @BeforeMethod
063: public void startUp() throws Exception {
064: bean = getBeanRemoteInstance(
065: SLSBSimpleEnvEntryFieldInjection00.class,
066: ItfSimpleEnvEntry.class);
067: beanInjectionByDescriptor = getBeanRemoteInstance(
068: SLSBSimpleEnvEntryByDescriptor.class,
069: ItfSimpleEnvEntryByDescriptor.class);
070: }
071:
072: /**
073: * Tests if a string value was correctly injected.
074: * @input -
075: * @output -
076: */
077: @Test
078: public void testString00() {
079: bean.checkString00();
080: }
081:
082: /**
083: * Tests if a character value was correctly injected.
084: * @input -
085: * @output -
086: */
087: @Test
088: public void testCharacter00() {
089: bean.checkCharacter00();
090: }
091:
092: /**
093: * Tests if an integer value was correctly injected.
094: * @input -
095: * @output -
096: */
097: @Test
098: public void testInteger00() {
099: bean.checkInteger00();
100: }
101:
102: /**
103: * Tests if a boolean value was correctly injected.
104: * @input -
105: * @output -
106: */
107: @Test
108: public void testBoolean00() {
109: bean.checkBoolean00();
110: }
111:
112: /**
113: * Tests if a double value was correctly injected.
114: * @input -
115: * @output -
116: */
117: @Test
118: public void testDouble00() {
119: bean.checkDouble00();
120: }
121:
122: /**
123: * Tests if a byte value was correctly injected.
124: * @input -
125: * @output -
126: */
127: @Test
128: public void testByte00() {
129: bean.checkByte00();
130: }
131:
132: /**
133: * Tests if a short value was correctly injected.
134: * @input -
135: * @output -
136: */
137: @Test
138: public void testShort00() {
139: bean.checkByte00();
140: }
141:
142: /**
143: * Tests if a byte value was correctly injected.
144: * @input -
145: * @output -
146: */
147: @Test
148: public void testLong00() {
149: bean.checkLong00();
150: }
151:
152: /**
153: * Tests if a float value was correctly injected.
154: * @input -
155: * @output -
156: */
157: @Test
158: public void testFloat00() {
159: bean.checkFloat00();
160: }
161:
162: /**
163: * Tests if a variable continues with its default value when the
164: * evn-entry-value is not specified.
165: * @input -
166: * @output -
167: */
168: @Test
169: public void testNotOverride00() {
170: beanInjectionByDescriptor.checkNotOverride00();
171: }
172:
173: /**
174: * Tests if injection by deployment descriptor using injection-target tag is working properly.
175: * @input -
176: * @output -
177: */
178: @Test
179: public void testInjectionByDeploymentDescriptor00() {
180: beanInjectionByDescriptor.checkStringInjection00();
181: }
182:
183: }
|