| java.lang.Object org.ow2.easybeans.tests.transaction.containermanaged.base.TestContainerTransactionBase org.ow2.easybeans.tests.transaction.containermanaged.stateful.TestSessionSynchronization
TestSessionSynchronization | public class TestSessionSynchronization extends TestContainerTransactionBase (Code) | | Verifies if the container-managed transaction in the stateful bean is
following the JSR 220.The test verifies if the SessionSynchronization Callbacks are working properly.
The items covered in this test are: 12.6.2.11.
author: Gisele Pinheiro Souza author: Eduardo Studzinski Estima de Castro |
Method Summary | |
public void | cleanTransaction() Makes a rollback in the transaction actives. | public void | createBean() Creates the bean before each test to avoid errors during the tests. | public void | deleteTable() Deletes the table before each test to avoid errors in each test. | public void | setup() Binds the databases used. | public void | testSessionSyncWithMandatory() Calls the method that uses the mandatory attribute.The bean implements the
SessionSynchronization interface, so the methods afterBegin,
beforeCompletion and afterCompletion must be called. | public void | testSessionSyncWithNever() Calls the method with transaction attribute never and verifies if the
container did not call the callbacks methdos from SessionSynchronization
interface. | public void | testSessionSyncWithNotSupported() Calls the method with transaction attribute not_supported and verifies if the
container did not call the callbacks methdos from SessionSynchronization
interface. | public void | testSessionSyncWithOnlySupports() Calls the method with transaction attribute supports and verifies if the
container did not call the callbacks methdos from SessionSynchronization
interface. | public void | testSessionSyncWithRequired() Calls the method that uses the required attribute.The bean implements the
SessionSynchronization interface, so the methods afterBegin,
beforeCompletion and afterCompletion must be called. | public void | testSessionSyncWithRequiresNew() Calls the method that uses the requires_new attribute.The bean implements the
SessionSynchronization interface, so the methods afterBegin,
beforeCompletion and afterCompletion must be called. | public void | testSessionSyncWithUserTransAndSupports() Calls the method with transaction attribute supports and verifies if the
methods callback are called. |
cleanTransaction | public void cleanTransaction() throws Exception(Code) | | Makes a rollback in the transaction actives.
throws: Exception - if a transaction exception occurs. |
createBean | public void createBean() throws Exception(Code) | | Creates the bean before each test to avoid errors during the tests.
throws: Exception - if an error during the bean creation occurs. |
deleteTable | public void deleteTable()(Code) | | Deletes the table before each test to avoid errors in each test.
|
setup | public void setup() throws Exception(Code) | | Binds the databases used.
throws: Exception - if an error during the test startup occurs. |
testSessionSyncWithMandatory | public void testSessionSyncWithMandatory() throws Exception(Code) | | Calls the method that uses the mandatory attribute.The bean implements the
SessionSynchronization interface, so the methods afterBegin,
beforeCompletion and afterCompletion must be called. The method
beforeCompletion calls setRollbackOnly, so the transaction must be
rolled back.
throws: Exception - if an error occurs during the tests. |
testSessionSyncWithNever | public void testSessionSyncWithNever() throws Exception(Code) | | Calls the method with transaction attribute never and verifies if the
container did not call the callbacks methdos from SessionSynchronization
interface. The container must no call this methods, because the method is
not in a transaction context.
throws: Exception - if an error occurs during the tests. |
testSessionSyncWithNotSupported | public void testSessionSyncWithNotSupported() throws Exception(Code) | | Calls the method with transaction attribute not_supported and verifies if the
container did not call the callbacks methdos from SessionSynchronization
interface. The container must no call this methods, because the method is
not in a transaction context.
throws: Exception - if an error occurs during the tests. |
testSessionSyncWithOnlySupports | public void testSessionSyncWithOnlySupports() throws Exception(Code) | | Calls the method with transaction attribute supports and verifies if the
container did not call the callbacks methdos from SessionSynchronization
interface. The container must no call this methods, because the method is
not in a transaction context.
throws: Exception - if an error occurs during the tests. |
testSessionSyncWithRequired | public void testSessionSyncWithRequired() throws Exception(Code) | | Calls the method that uses the required attribute.The bean implements the
SessionSynchronization interface, so the methods afterBegin,
beforeCompletion and afterCompletion must be called. The method
beforeCompletion calls setRollbackOnly, so the transaction must be rolled
back.
throws: Exception - if an error occurs during the tests. |
testSessionSyncWithRequiresNew | public void testSessionSyncWithRequiresNew() throws Exception(Code) | | Calls the method that uses the requires_new attribute.The bean implements the
SessionSynchronization interface, so the methods afterBegin,
beforeCompletion and afterCompletion must be called. The method
beforeCompletion calls setRollbackOnly, so the transaction must be
rolled back.
throws: Exception - if an error occurs during the tests. |
testSessionSyncWithUserTransAndSupports | public void testSessionSyncWithUserTransAndSupports() throws Exception(Code) | | Calls the method with transaction attribute supports and verifies if the
methods callback are called. The transaction attribute supports must to
have the same behaviour that the required.
throws: Exception - if an error occurs during the tests. |
Fields inherited from org.ow2.easybeans.tests.transaction.containermanaged.base.TestContainerTransactionBase | final protected static String DATABASE_1(Code)(Java Doc) final protected static String DATABASE_2(Code)(Java Doc)
|
|
|