KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > tests > transaction > containermanaged > stateful > TestMandatoryRemoteSFSB


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: TestMandatoryRemoteSFSB.java 980 2006-07-28 13:20:32Z studzine $
23  * --------------------------------------------------------------------------
24  */

25 package org.objectweb.easybeans.tests.transaction.containermanaged.stateful;
26
27 import java.sql.SQLException JavaDoc;
28
29 import javax.ejb.EJBTransactionRequiredException JavaDoc;
30
31 import org.objectweb.easybeans.tests.common.ejbs.stateful.containermanaged.transaction.SFSBContainerTransactionMandatory;
32 import org.objectweb.easybeans.tests.transaction.containermanaged.base.TestMandatory;
33 import org.testng.annotations.BeforeClass;
34 import org.testng.annotations.BeforeMethod;
35 import org.testng.annotations.Test;
36
37 /**
38  * Verifies if the container-managed transaction in the stateful bean is
39  * following the JSR 220.The items covered in this test are: 12.6.2.5.
40  * @reference JSR 220-PROPOSED FINAL
41  * @requirement Application Server must be running; the bean
42  * org.objectweb.easybeans.tests.common.ejbs.stateful.containermanaged.SFSBContainerTransactionMandatory
43  * must be deployed.
44  * @setup gets the reference of SFSBContainerTransactionMandatory and binds the
45  * databases specified in the EmbeddedTest.
46  * @author Gisele Pinheiro Souza
47  * @author Eduardo Studzinski Estima de Castro
48  */

49 public class TestMandatoryRemoteSFSB extends TestMandatory {
50
51
52     /**
53      * Creates a new instance of the bean.
54      * @throws Exception if a lookup error occurs.
55      */

56     @BeforeMethod
57     public void createBean() throws Exception JavaDoc {
58         super.createBean(SFSBContainerTransactionMandatory.class);
59     }
60
61     /**
62      * @see org.objectweb.easybeans.tests.transaction.containermanaged.base.TestMandatory
63      * @throws Exception if an error during the test startup occurs.
64      */

65     @BeforeClass
66     @Override JavaDoc
67     public void setup() throws Exception JavaDoc {
68         super.setup();
69     }
70
71     /**
72      * @see org.objectweb.easybeans.tests.transaction.containermanaged.base.TestMandatory
73      * @throws Exception if an error during the tests occurs.
74      */

75     @Test(groups = {"mandatory attribute features"}, alwaysRun = true, expectedExceptions = SQLException JavaDoc.class)
76     @Override JavaDoc
77     public void testUsingClientTrans() throws Exception JavaDoc {
78         super.testUsingClientTrans();
79     }
80
81     /**
82      * @see org.objectweb.easybeans.tests.transaction.containermanaged.base.TestMandatory
83      * @throws Exception if an error occurs during the tests.
84      */

85     @Test(groups = {"rollback"})
86     @Override JavaDoc
87     public void testSetRollbackOnlyWithUserTransaction() throws Exception JavaDoc {
88          super.testSetRollbackOnlyWithUserTransaction();
89     }
90
91     /**
92      * @see org.objectweb.easybeans.tests.transaction.containermanaged.base.TestMandatory
93      * @throws Exception if an error occurs during the tests.
94      */

95     @Test(groups = {"rollback"}, expectedExceptions = EJBTransactionRequiredException JavaDoc.class)
96     @Override JavaDoc
97     public void testSetRollbackOnlyWithoutUserTransaction() throws Exception JavaDoc {
98          super.testSetRollbackOnlyWithoutUserTransaction();
99     }
100
101     /**
102      * @see org.objectweb.easybeans.tests.transaction.containermanaged.base.TestMandatory
103      * @throws Exception if an error occurs during the tests.
104      */

105     @Test(groups = {"rollback"})
106     @Override JavaDoc
107     public void testGetRollbackOnlyWithUserTransaction() throws Exception JavaDoc {
108          super.testGetRollbackOnlyWithUserTransaction();
109
110     }
111
112     /**
113      * @see org.objectweb.easybeans.tests.transaction.containermanaged.base.TestMandatory
114      * @throws Exception if an error occurs during the tests.
115      */

116     @Test(groups = {"rollback"}, expectedExceptions = EJBTransactionRequiredException JavaDoc.class)
117     @Override JavaDoc
118     public void testGetRollbackOnlyWithoutUserTransaction() throws Exception JavaDoc {
119          super.testGetRollbackOnlyWithoutUserTransaction();
120     }
121
122     /**
123      * @see org.objectweb.easybeans.tests.transaction.containermanaged.base.TestMandatory
124      */

125     @BeforeMethod
126     @Override JavaDoc
127     public void deleteTable() {
128         super.deleteTable();
129     }
130
131     /**
132      * Makes a rollback in the transaction actives.
133      * @throws Exception if a transaction exception occurs.
134      */

135     @BeforeMethod
136     @Override JavaDoc
137     public void cleanTransaction() throws Exception JavaDoc{
138         super.cleanTransaction();
139     }
140
141     /**
142      * @see org.objectweb.easybeans.tests.transaction.containermanaged.base.TestMandatory
143      * @throws Exception if an error during the tests occurs.
144      */

145     @Test(groups = {"general attribute features"}, expectedExceptions = java.lang.IllegalStateException JavaDoc.class)
146     @Override JavaDoc
147     public void testGetUserTransactionWithEJBContext() throws Exception JavaDoc {
148         super.testGetUserTransactionWithEJBContext();
149     }
150
151     /**
152      * @see org.objectweb.easybeans.tests.transaction.containermanaged.base.TestMandatory
153      * @throws Exception if an error during the tests occurs.
154      */

155     @Test(groups = {"general attribute features"}, expectedExceptions = javax.naming.NameNotFoundException JavaDoc.class)
156     @Override JavaDoc
157     public void testGetUserTransactionWithLookup() throws Exception JavaDoc {
158         super.testGetUserTransactionWithLookup();
159     }
160 }
161
Popular Tags