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: TestTransAttribute.java 1970 2007-10-16 11:49:25Z benoitf $
023: * --------------------------------------------------------------------------
024: */package org.ow2.easybeans.tests.deploymentdesc;
025:
026: import org.ow2.easybeans.tests.common.ejbs.stateful.containermanaged.xmldescriptor.ItfTransAttributeTester;
027: import org.ow2.easybeans.tests.common.ejbs.stateful.containermanaged.xmldescriptor.SFSBTransAttributeTester;
028: import org.ow2.easybeans.tests.common.helper.EJBHelper;
029: import org.testng.annotations.BeforeMethod;
030: import org.testng.annotations.Test;
031:
032: /**
033: * Verifies if the container can deploy an bean with the transaction attributes
034: * defined in the deployment description. Item 13.3.7
035: * @reference JSR 220 - FINAL RELEASE
036: * @requirement the bean SFSBCTransAttributeTester, the SLSBDatabaseManager and the SFSBCTransAttributeDefinition must be
037: * deployed to make the tests, and, the deployment descriptor must
038: * be used too.
039: * @setup gets an instance of the SFSBCTransAttributeTester.
040: * @author Gisele Pinheiro Souza
041: * @author Eduardo Studzinski Estima de Castro
042: */
043: public class TestTransAttribute {
044:
045: /**
046: * Bean used to verify the local access.
047: */
048: private ItfTransAttributeTester tester;
049:
050: /**
051: * Creates the stateful bean used during the tests.
052: * @throws Exception if an error occurs during the lookup.
053: */
054: @BeforeMethod
055: public void setup() throws Exception {
056: tester = EJBHelper.getBeanRemoteInstance(
057: SFSBTransAttributeTester.class,
058: ItfTransAttributeTester.class);
059: }
060:
061: /**
062: * Verifies if the transaction attribute mandatory defined in the deployment
063: * descriptor is read by the container.
064: * @input -
065: * @output the correct method execution.
066: * @throws Exception if an error occurs.
067: */
068: @Test
069: public void testMandatory() throws Exception {
070: tester.testMandatory();
071: }
072:
073: /**
074: * Verifies if the transaction attribute required defined in the deployment
075: * descriptor is read by the container. *
076: * @input -
077: * @output the correct method execution.
078: * @throws Exception if an error occurs.
079: */
080: @Test
081: public void testRequired() throws Exception {
082: tester.testRequired();
083: }
084:
085: /**
086: * Verifies if the transaction attribute requires new defined in the
087: * deployment descriptor is read by the container. *
088: * @input -
089: * @output the correct method execution.
090: * @throws Exception if an error occurs.
091: */
092: @Test
093: public void testRequiresNew() throws Exception {
094: tester.testRequiresNew();
095: }
096:
097: /**
098: * Verifies if the transaction attribute supports defined in the deployment
099: * descriptor is read by the container. *
100: * @input -
101: * @output the correct method execution.
102: * @throws Exception if an error occurs.
103: */
104: @Test
105: public void testSupports() throws Exception {
106: tester.testSupports();
107: }
108:
109: /**
110: * Verifies if the transaction attribute not supported defined in the
111: * deployment descriptor is read by the container. *
112: * @input -
113: * @output the correct method execution.
114: * @throws Exception if an error occurs.
115: */
116: @Test
117: public void testNotSupported() throws Exception {
118: tester.testNotSupported();
119: }
120:
121: /**
122: * Verifies if the transaction attribute never defined in the deployment
123: * descriptor is read by the container. *
124: * @input -
125: * @output the correct method execution.
126: * @throws Exception if an error occurs.
127: */
128: @Test
129: public void testNever() throws Exception {
130: tester.testNever();
131: }
132: }
|