001: /**
002: * EasyBeans
003: * Copyright (C) 2006 Bull S.A.S.
004: * Contact: easybeans@ow2.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * --------------------------------------------------------------------------
022: * $Id: TestDefaultRemoteSFSB.java 1970 2007-10-16 11:49:25Z benoitf $
023: * --------------------------------------------------------------------------
024: */package org.ow2.easybeans.tests.transaction.containermanaged.stateful;
025:
026: import java.sql.SQLException;
027:
028: import org.ow2.easybeans.tests.common.ejbs.stateful.containermanaged.transaction.SFSBContainerTransactionDefault;
029: import org.ow2.easybeans.tests.transaction.containermanaged.base.TestRequired;
030: import org.testng.annotations.BeforeClass;
031: import org.testng.annotations.BeforeMethod;
032: import org.testng.annotations.Test;
033:
034: /**
035: * Verifies if the container-managed transaction in the stateful bean is
036: * following the JSR 220.The items covered in this test are: 12.3.7.
037: * @reference JSR 220-PROPOSED FINAL
038: * @requirement Application Server must be running; the bean
039: * org.ow2.easybeans.tests.common.ejbs.stateful.containermanaged.SFSBContainerTransactionDefault
040: * must be deployed.
041: * @setup gets the reference of the bean and binds the
042: * databases specified in the EmbeddedTest.
043: * @author Gisele Pinheiro Souza
044: * @author Eduardo Studzinski Estima de Castro
045: */
046: public class TestDefaultRemoteSFSB extends TestRequired {
047:
048: /**
049: * Creates a new instance of the bean.
050: * @throws Exception if a lookup error occurs.
051: */
052: @BeforeMethod
053: public void createBean() throws Exception {
054: super .createBean(SFSBContainerTransactionDefault.class);
055: }
056:
057: /**
058: * @see org.ow2.easybeans.tests.transaction.containermanaged.base.TestRequired
059: * @throws Exception if an error during the test startup occurs.
060: */
061: @BeforeClass
062: @Override
063: public void setup() throws Exception {
064: super .setup();
065: }
066:
067: /**
068: * @see org.ow2.easybeans.tests.transaction.containermanaged.base.TestRequired
069: * @throws Exception if an error during the tests occurs.
070: */
071: @Test(groups={"default attribute features"},expectedExceptions=SQLException.class)
072: @Override
073: public void testUsingClientTrans() throws Exception {
074: super .testUsingClientTrans();
075: }
076:
077: /**
078: * @see org.ow2.easybeans.tests.transaction.containermanaged.base.TestRequired
079: * @throws Exception if an error occurs during the tests.
080: */
081: @Test(groups={"rollback"},expectedExceptions=SQLException.class)
082: @Override
083: public void testSetRollbackOnly() throws Exception {
084: super .testSetRollbackOnly();
085: }
086:
087: /**
088: * @see org.ow2.easybeans.tests.transaction.containermanaged.base.TestRequired
089: * @throws Exception if an error occurs during the tests.
090: */
091: @Test(groups={"rollback"})
092: @Override
093: public void testGetRollbackOnly() throws Exception {
094: super .testGetRollbackOnly();
095: }
096:
097: /**
098: * @see org.ow2.easybeans.tests.transaction.containermanaged.base.TestRequired
099: */
100: @BeforeMethod
101: @Override
102: public void deleteTable() {
103: super .deleteTable();
104: }
105:
106: /**
107: * @see org.ow2.easybeans.tests.transaction.containermanaged.base.TestRequired
108: * @throws Exception if an error during the tests occurs.
109: */
110: @Test(groups={"general attribute features"},expectedExceptions=java.lang.IllegalStateException.class)
111: @Override
112: public void testGetUserTransactionWithEJBContext() throws Exception {
113: super .testGetUserTransactionWithEJBContext();
114: }
115:
116: /**
117: * @see org.ow2.easybeans.tests.transaction.containermanaged.base.TestRequired
118: * @throws Exception if an error during the tests occurs.
119: */
120: @Test(groups={"general attribute features"},expectedExceptions=javax.naming.NameNotFoundException.class)
121: @Override
122: public void testGetUserTransactionWithLookup() throws Exception {
123: super .testGetUserTransactionWithLookup();
124: }
125:
126: /**
127: * Makes a rollback in the transaction actives.
128: * @throws Exception if a transaction exception occurs.
129: */
130: @BeforeMethod
131: @Override
132: public void cleanTransaction() throws Exception {
133: super.cleanTransaction();
134: }
135:
136: }
|