| java.lang.Object org.ow2.easybeans.tests.common.ejbs.base.persistencectxlife.BasePctxLifeCMETester00
All known Subclasses: org.ow2.easybeans.tests.persistence.lifetime.TestPersistenceLifetimeCMExtended00, org.ow2.easybeans.tests.common.ejbs.stateless.beanmanaged.persistencectxlife.SLSBPCtxLifeCMETest00,
BasePctxLifeCMETester00 | public class BasePctxLifeCMETester00 (Code) | | Base class for container-managed extended-scoped persistence context tests.
author: Eduardo Studzinski Estima de Castro author: Gisele Pinheiro Souza |
Method Summary | |
public void | setBean(ItfPCtxLifetime00 bean) Sets the bean 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() This test creates an entity and verifies if it remains managed. | public void | test04() This test creates an entity, persists the entity and verifies if it remains managed. |
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 remains managed, because it is an extended 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 extended persistence context,
the entity must be managed after its creation. After this step,
the test rolls back the transaction and the entity must become detached.
throws: Exception - if a problem occurs. |
test03 | public void test03() throws Exception(Code) | | This test creates an entity and verifies if it remains managed.
In this test, the transaction is created by the container for each bean method invocation,
however, as it is an extended persistence context, it must remains managed.
throws: Exception - if a problem occurs. |
test04 | public void test04() throws Exception(Code) | | This test creates an entity, persists the entity and verifies if it remains managed.
In this test, the transaction is created by the container for each bean method invocation,
however, as it is an extended persistence context, it must remains managed.
throws: Exception - if a problem occurs. |
|
|