| java.lang.Object org.ow2.easybeans.tests.common.ejbs.base.persistencectxlife.BasePctxLifeCMTTester00 org.ow2.easybeans.tests.persistence.lifetime.TestPersistenceLifetimeCMTransaction00
TestPersistenceLifetimeCMTransaction00 | public class TestPersistenceLifetimeCMTransaction00 extends BasePctxLifeCMTTester00 (Code) | | Tests container-managed transaction-scoped persistence context. It uses this test class as client and a
Stateful with transaction-scoped persistence context.
In this scope, the lifecycle of a persistence context ends when the associated transaction ends.
author: Eduardo Studzinski Estima de Castro author: Gisele Pinheiro Souza |
Method Summary | |
public void | startUp() Gets bean instances used in the tests. | public void | tearDown() Cleans the test results. | public void | test00() This test begins a transaction, creates an entity and rolls back the transaction. | public void | test01() This test begins a transaction, creates an entity and commits the transaction. | public void | test02() This test begins a transaction and creates an entity. | public void | test03() Tests if an entity manager with a stateful can manage a
transaction-scoped persistence context. | public void | test04() Tests if an entity manager with a stateful can manage a
transaction-scoped persistence context. |
startUp | public void startUp() throws Exception(Code) | | Gets bean instances used in the tests.
throws: Exception - if there is a problem with the bean initialization. |
test00 | public void test00() throws Exception(Code) | | This test begins a transaction, creates an entity and rolls back the transaction.
The entity must not exists after the rollback and the entity instance must become detached.
A rollback in a transaction, which is used with the persistence context,
always turns detached all entities associated with the persistence context.
throws: Exception - if a problem occurs. |
test01 | public void test01() throws Exception(Code) | | This test begins a transaction, creates an entity and commits the transaction. The entity must
exists after the commit and it must become detached, because it is an transaction persistence context.
throws: Exception - if a problem occurs. |
test02 | public void test02() throws Exception(Code) | | This test begins a transaction and creates an entity. As it uses an transaction
persistence context and the transaction is still open,
the entity remains managed after its creation. After this step,
the test rolls back the transaction and the entity must be removed.
throws: Exception - if a problem occurs. |
test03 | public void test03() throws Exception(Code) | | Tests if an entity manager with a stateful can manage a
transaction-scoped persistence context.
throws: Exception - if a problem occurs. |
test04 | public void test04() throws Exception(Code) | | Tests if an entity manager with a stateful can manage a
transaction-scoped persistence context.
throws: Exception - if a problem occurs. |
|
|