01: /**
02: * EasyBeans
03: * Copyright (C) 2006 Bull S.A.S.
04: * Contact: easybeans@ow2.org
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * 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: */package org.ow2.easybeans.tests.javasesupport;
25:
26: import org.testng.annotations.BeforeMethod;
27: import org.testng.annotations.Test;
28:
29: /**
30: * Verifies if the bean can use a resource level transaction.
31: * @reference JSR 220-PROPOSED FINAL
32: * @requirement Application Server must be running; the entity Book must be
33: * deployed.
34: * @setup gets the reference of ResourceLevelTransTester
35: * @author Gisele Pinheiro Souza
36: * @author Eduardo Studzinski Estima de Castro
37: */
38: public class TestResourceLevelTransaction {
39:
40: /**
41: * Common class used during the tests.
42: */
43: private ResourceLevelTransTester resourceLevelTransTester;
44:
45: /**
46: * Creates an instance of the esourceLevelTransTester.
47: * @throws Exception if an error occurs during the lookup.
48: */
49: @BeforeMethod
50: public void setup() throws Exception {
51: resourceLevelTransTester = new ResourceLevelTransTester();
52: }
53:
54: /**
55: * Verifies if the EnitityTransaction.rollback() works.
56: * @input -
57: * @output the correct method execution
58: *
59: */
60: @Test
61: public void testResourceLevelRollback() {
62: resourceLevelTransTester.resourceLevelRollback();
63: }
64:
65: /**
66: * Verifies if the EnitityTransaction.commit() works.
67: * @input -
68: * @output the correct method execution
69: *
70: */
71: @Test
72: public void testResourceLevelCommit() {
73: resourceLevelTransTester.resourceLevelCommit();
74: }
75:
76: /**
77: * Verifies if the EnitityTransaction.setRollbackOnly() works.
78: * @input -
79: * @output the correct method execution
80: *
81: */
82: @Test
83: public void testResourceLevelSetRollbackOnly() {
84: resourceLevelTransTester.setRollbackOnly();
85: }
86:
87: }
|