KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > tests > javasesupport > TestResourceLevelTransaction


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:TestResourceLevelTransaction.java 505 2006-05-24 14:28:38Z pinheirg $
23  * --------------------------------------------------------------------------
24  */

25 package org.objectweb.easybeans.tests.javasesupport;
26
27 import org.testng.annotations.BeforeMethod;
28 import org.testng.annotations.Test;
29
30 /**
31  * Verifies if the bean can use a resource level transaction.
32  * @reference JSR 220-PROPOSED FINAL
33  * @requirement Application Server must be running; the entity Book must be
34  * deployed.
35  * @setup gets the reference of ResourceLevelTransTester
36  * @author Gisele Pinheiro Souza
37  * @author Eduardo Studzinski Estima de Castro
38  */

39 public class TestResourceLevelTransaction {
40
41     /**
42      * Common class used during the tests.
43      */

44     private ResourceLevelTransTester resourceLevelTransTester;
45
46     /**
47      * Creates an instance of the esourceLevelTransTester.
48      * @throws Exception if an error occurs during the lookup.
49      */

50     @BeforeMethod
51     public void setup() throws Exception JavaDoc {
52         resourceLevelTransTester = new ResourceLevelTransTester();
53     }
54
55     /**
56      * Verifies if the EnitityTransaction.rollback() works.
57      * @input -
58      * @output the correct method execution
59      *
60      */

61     @Test
62     public void testResourceLevelRollback(){
63         resourceLevelTransTester.resourceLevelRollback();
64     }
65
66     /**
67      * Verifies if the EnitityTransaction.commit() works.
68      * @input -
69      * @output the correct method execution
70      *
71      */

72     @Test
73     public void testResourceLevelCommit(){
74         resourceLevelTransTester.resourceLevelCommit();
75     }
76
77     /**
78      * Verifies if the EnitityTransaction.setRollbackOnly() works.
79      * @input -
80      * @output the correct method execution
81      *
82      */

83     @Test
84     public void testResourceLevelSetRollbackOnly(){
85         resourceLevelTransTester.setRollbackOnly();
86     }
87
88 }
89
Popular Tags