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: TestRequiredNewRemoteSFSB.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.SFSBContainerTransactionRequiredNew;
029: import org.ow2.easybeans.tests.transaction.containermanaged.base.TestRequiredNew;
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.6.2.4.
037: * @reference JSR 220-PROPOSED FINAL
038: * @requirement Application Server must be running; the bean
039: * org.ow2.easybeans.tests.common.ejbs.stateful.containermanaged.SFSBContainerTransactionRequiredNew
040: * must be deployed.
041: * @setup gets the reference of SFSBContainerTransactionRequiredNew and binds
042: * the databases specified in the EmbeddedTest.
043: * @author Gisele Pinheiro Souza
044: * @author Eduardo Studzinski Estima de Castro
045: */
046: public class TestRequiredNewRemoteSFSB extends TestRequiredNew {
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(SFSBContainerTransactionRequiredNew.class);
055: }
056:
057: /**
058: * @see org.ow2.easybeans.tests.transaction.containermanaged.base.TestRequiredNew
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.TestRequiredNew
069: * @throws Exception if an error occurs during the tests.
070: */
071: @Test(groups={"rollback"},expectedExceptions=SQLException.class)
072: @Override
073: public void testSetRollbackOnly() throws Exception {
074: super .testSetRollbackOnly();
075: }
076:
077: /**
078: * @see org.ow2.easybeans.tests.transaction.containermanaged.base.TestRequiredNew
079: * @throws Exception if an error occurs during the tests.
080: */
081: @Test(groups={"rollback"})
082: @Override
083: public void testGetRollbackOnly() throws Exception {
084: super .testGetRollbackOnly();
085: }
086:
087: /**
088: * @see org.ow2.easybeans.tests.transaction.containermanaged.base.TestRequiredNew
089: */
090: @BeforeMethod
091: @Override
092: public void deleteTable() {
093: super .deleteTable();
094: }
095:
096: /**
097: * @see org.ow2.easybeans.tests.transaction.containermanaged.base.TestRequiredNew
098: * @throws Exception if an error during the tests occurs.
099: */
100: @Test(groups={"general attribute features"},expectedExceptions=java.lang.IllegalStateException.class)
101: @Override
102: public void testGetUserTransactionWithEJBContext() throws Exception {
103: super .testGetUserTransactionWithEJBContext();
104: }
105:
106: /**
107: * @see org.ow2.easybeans.tests.transaction.containermanaged.base.TestRequiredNew
108: * @throws Exception if an error during the tests occurs.
109: */
110: @Test(groups={"general attribute features"},expectedExceptions=javax.naming.NameNotFoundException.class)
111: @Override
112: public void testGetUserTransactionWithLookup() throws Exception {
113: super .testGetUserTransactionWithLookup();
114: }
115:
116: /**
117: * Makes a rollback in the transaction actives.
118: * @throws Exception if a transaction exception occurs.
119: */
120: @BeforeMethod
121: @Override
122: public void cleanTransaction() throws Exception {
123: super.cleanTransaction();
124: }
125:
126: }
|