KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > tests > transaction > containermanaged > stateless > TestMandatoryRemoteSLSB


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

25 package org.objectweb.easybeans.tests.transaction.containermanaged.stateless;
26
27 import java.sql.SQLException JavaDoc;
28
29 import javax.ejb.EJBTransactionRequiredException JavaDoc;
30
31 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.transaction.SLSBContainerTransactionMandatory;
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 stateless 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.stateless.containermanaged.SLSBContainerTransactionMandatory
43  * must be deployed.
44  * @setup gets the reference of SLSBContainerTransactionMandatory 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 TestMandatoryRemoteSLSB 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(SLSBContainerTransactionMandatory.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     /**
83      * @see org.objectweb.easybeans.tests.transaction.containermanaged.base.TestMandatory
84      * @throws Exception if an error occurs during the tests.
85      */

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

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

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

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

126     @BeforeMethod
127     @Override JavaDoc
128     public void deleteTable() {
129           super.deleteTable();
130     }
131
132     /**
133      * @see org.objectweb.easybeans.tests.transaction.containermanaged.base.TestMandatory
134      * @throws Exception if an error during the tests occurs.
135      */

136     @Test(groups = {"general attribute features"}, expectedExceptions = java.lang.IllegalStateException JavaDoc.class)
137     @Override JavaDoc
138     public void testGetUserTransactionWithEJBContext() throws Exception JavaDoc {
139         super.testGetUserTransactionWithEJBContext();
140     }
141
142     /**
143      * @see org.objectweb.easybeans.tests.transaction.containermanaged.base.TestMandatory
144      * @throws Exception if an error during the tests occurs.
145      */

146     @Test(groups = {"general attribute features"}, expectedExceptions = javax.naming.NameNotFoundException JavaDoc.class)
147     @Override JavaDoc
148     public void testGetUserTransactionWithLookup() throws Exception JavaDoc {
149         super.testGetUserTransactionWithLookup();
150     }
151
152    /**
153      * Makes a rollback in the transaction actives.
154      * @throws Exception if a transaction exception occurs.
155      */

156     @BeforeMethod
157     @Override JavaDoc
158     public void cleanTransaction() throws Exception JavaDoc{
159         super.cleanTransaction();
160     }
161 }
162
Popular Tags