KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > tests > deploymentdesc > TestTransAttribute


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: TestTransAttribute.java 977 2006-07-28 13:18:26Z studzine $
23  * --------------------------------------------------------------------------
24  */

25 package org.objectweb.easybeans.tests.deploymentdesc;
26
27 import org.objectweb.easybeans.tests.common.ejbs.stateful.containermanaged.xmldescriptor.ItfTransAttributeTester;
28 import org.objectweb.easybeans.tests.common.ejbs.stateful.containermanaged.xmldescriptor.SFSBTransAttributeTester;
29 import org.objectweb.easybeans.tests.common.helper.EJBHelper;
30 import org.testng.annotations.BeforeMethod;
31 import org.testng.annotations.Test;
32
33 /**
34  * Verifies if the container can deploy an bean with the transaction attributes
35  * defined in the deployment description. Item 13.3.7
36  * @reference JSR 220 - FINAL RELEASE
37  * @requirement the bean SFSBCTransAttributeTester, the SLSBDatabaseManager and the SFSBCTransAttributeDefinition must be
38  * deployed to make the tests, and, the deployment descriptor must
39  * be used too.
40  * @setup gets an instance of the SFSBCTransAttributeTester.
41  * @author Gisele Pinheiro Souza
42  * @author Eduardo Studzinski Estima de Castro
43  */

44 public class TestTransAttribute {
45
46     /**
47      * Bean used to verify the local access.
48      */

49     private ItfTransAttributeTester tester;
50
51     /**
52      * Creates the stateful bean used during the tests.
53      * @throws Exception if an error occurs during the lookup.
54      */

55     @BeforeMethod
56     public void setup() throws Exception JavaDoc {
57         tester = EJBHelper.getBeanRemoteInstance(SFSBTransAttributeTester.class, ItfTransAttributeTester.class);
58     }
59
60     /**
61      * Verifies if the transaction attribute mandatory defined in the deployment
62      * descriptor is read by the container.
63      * @input -
64      * @output the correct method execution.
65      * @throws Exception if an error occurs.
66      */

67     @Test
68     public void testMandatory() throws Exception JavaDoc {
69         tester.testMandatory();
70     }
71
72     /**
73      * Verifies if the transaction attribute required defined in the deployment
74      * descriptor is read by the container. *
75      * @input -
76      * @output the correct method execution.
77      * @throws Exception if an error occurs.
78      */

79     @Test
80     public void testRequired() throws Exception JavaDoc {
81         tester.testRequired();
82     }
83
84     /**
85      * Verifies if the transaction attribute requires new defined in the
86      * deployment descriptor is read by the container. *
87      * @input -
88      * @output the correct method execution.
89      * @throws Exception if an error occurs.
90      */

91     @Test
92     public void testRequiresNew() throws Exception JavaDoc {
93         tester.testRequiresNew();
94     }
95
96     /**
97      * Verifies if the transaction attribute supports defined in the deployment
98      * descriptor is read by the container. *
99      * @input -
100      * @output the correct method execution.
101      * @throws Exception if an error occurs.
102      */

103     @Test
104     public void testSupports() throws Exception JavaDoc {
105         tester.testSupports();
106     }
107
108     /**
109      * Verifies if the transaction attribute not supported defined in the
110      * deployment descriptor is read by the container. *
111      * @input -
112      * @output the correct method execution.
113      * @throws Exception if an error occurs.
114      */

115     @Test
116     public void testNotSupported() throws Exception JavaDoc {
117         tester.testNotSupported();
118     }
119
120     /**
121      * Verifies if the transaction attribute never defined in the deployment
122      * descriptor is read by the container. *
123      * @input -
124      * @output the correct method execution.
125      * @throws Exception if an error occurs.
126      */

127     @Test
128     public void testNever() throws Exception JavaDoc {
129         tester.testNever();
130     }
131 }
132
Popular Tags