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: TestNeverRemoteSLSB.java 1970 2007-10-16 11:49:25Z benoitf $
023: * --------------------------------------------------------------------------
024: */package org.ow2.easybeans.tests.transaction.containermanaged.stateless;
025:
026: import org.ow2.easybeans.tests.common.ejbs.stateless.containermanaged.transaction.SLSBContainerTransactionNever;
027: import org.ow2.easybeans.tests.transaction.containermanaged.base.TestNever;
028: import org.testng.annotations.BeforeClass;
029: import org.testng.annotations.BeforeMethod;
030: import org.testng.annotations.Test;
031:
032: /**
033: * Verifies if the container-managed transaction in the stateless bean is
034: * following the JSR 220.The items covered in this test are: 12.6.2.6.
035: * @reference JSR 220-PROPOSED FINAL
036: * @requirement Application Server must be running; the bean
037: * org.ow2.easybeans.tests.common.ejbs.stateful.containermanaged.SLSBContainerTransactionNever
038: * must be deployed.
039: * @setup gets the reference of SLSBContainerTransactionNever and binds the
040: * databases specified in the EmbeddedTest.
041: * @author Gisele Pinheiro Souza
042: * @author Eduardo Studzinski Estima de Castro
043: */
044: public class TestNeverRemoteSLSB extends TestNever {
045:
046: /**
047: * Creates a new instance of the bean.
048: * @throws Exception if a lookup error occurs.
049: */
050: @BeforeMethod
051: public void createBean() throws Exception {
052: super .createBean(SLSBContainerTransactionNever.class);
053: }
054:
055: /**
056: * @see org.ow2.easybeans.tests.transaction.containermanaged.base.TestNever
057: * @throws Exception if an error during the test startup occurs.
058: */
059: @BeforeClass
060: @Override
061: public void setup() throws Exception {
062: super .setup();
063: }
064:
065: /**
066: * @see org.ow2.easybeans.tests.transaction.containermanaged.base.TestNever
067: * @throws Exception if an error during the tests occurs.
068: */
069: @Test(groups={"never attribute features"},expectedExceptions=javax.ejb.EJBException.class)
070: @Override
071: public void testUsingClientTrans() throws Exception {
072: super .testUsingClientTrans();
073: }
074:
075: /**
076: * @see org.ow2.easybeans.tests.transaction.containermanaged.base.TestNever
077: * @throws Exception if an error during the test occurs.
078: */
079: @Test(groups={"roll back"},expectedExceptions=java.lang.IllegalStateException.class)
080: @Override
081: public void testSetRollbackOnly() throws Exception {
082: super .testSetRollbackOnly();
083: }
084:
085: /**
086: * @see org.ow2.easybeans.tests.transaction.containermanaged.base.TestNever
087: * @throws Exception if an error during the test occurs.
088: */
089: @Test(groups={"roll back"},expectedExceptions=java.lang.IllegalStateException.class)
090: @Override
091: public void testGetRollbackOnly() throws Exception {
092: super .testGetRollbackOnly();
093: }
094:
095: /**
096: * @see org.ow2.easybeans.tests.transaction.containermanaged.base.TestNever
097: */
098: @BeforeMethod
099: @Override
100: public void deleteTable() {
101: super .deleteTable();
102: }
103:
104: /**
105: * @see org.ow2.easybeans.tests.transaction.containermanaged.base.TestNever
106: * @throws Exception if an error during the tests occurs.
107: */
108: @Test(groups={"general attribute features"},expectedExceptions=java.lang.IllegalStateException.class)
109: @Override
110: public void testGetUserTransactionWithEJBContext() throws Exception {
111: super .testGetUserTransactionWithEJBContext();
112: }
113:
114: /**
115: * @see org.ow2.easybeans.tests.transaction.containermanaged.base.TestNever
116: * @throws Exception if an error during the tests occurs.
117: */
118: @Test(groups={"general attribute features"},expectedExceptions=javax.naming.NameNotFoundException.class)
119: @Override
120: public void testGetUserTransactionWithLookup() throws Exception {
121: super .testGetUserTransactionWithLookup();
122: }
123:
124: /**
125: * Makes a rollback in the transaction actives.
126: * @throws Exception if a transaction exception occurs.
127: */
128: @BeforeMethod
129: @Override
130: public void cleanTransaction() throws Exception {
131: super.cleanTransaction();
132: }
133: }
|