public class SingletonBeanTxTests extends NamedTestCase
NumberedTestCase.NamedTest, NumberedTestCase.TestSetup, NumberedTestCase.TestTearDown| Modifier and Type | Field and Description |
|---|---|
protected javax.ejb.Handle |
ejbHandle |
protected BeanTxSingletonHome |
ejbHome |
protected javax.ejb.HomeHandle |
ejbHomeHandle |
protected javax.ejb.EJBMetaData |
ejbMetaData |
protected BeanTxSingletonObject |
ejbObject |
protected Integer |
ejbPrimaryKey |
protected InitialContext |
initialContext |
static String |
jndiEJBHomeEntry |
testNamestandardPrefix| Constructor and Description |
|---|
SingletonBeanTxTests() |
| Modifier and Type | Method and Description |
|---|---|
void |
BUG_test06_singleTransactionRollback()
This test does work for the IntraVM Server, but it fails on
the Remote Server.
|
protected void |
setUp()
Sets up the fixture, for example, open a network connection.
|
protected void |
tearDown()
Tears down the fixture, for example, close a network connection.
|
void |
test01_EJBContext_getUserTransaction()
11.6.1 Bean-managed transaction demarcation
The Container must make the javax.transaction.UserTransaction interface available to
the enterprise bean's business method via the javax.ejb.EJBContext interface and under the
environment entry java:comp/UserTransaction.
|
void |
test02_java_comp_UserTransaction()
11.6.1 Bean-managed transaction demarcation
The Container must make the javax.transaction.UserTransaction interface available to
the enterprise bean's business method via the javax.ejb.EJBContext interface and under the
environment entry java:comp/UserTransaction.
|
void |
test05_singleTransactionCommit() |
void |
TODO_test03_EJBContext_setRollbackOnly()
11.6.1 Bean-managed transaction demarcation
The Container must throw the java.lang.IllegalStateException if an instance of a bean
with bean-managed transaction demarcation attempts to invoke the setRollbackOnly() or
getRollbackOnly() method of the javax.ejb.EJBContext interface.
|
void |
TODO_test04_EJBContext_getRollbackOnly()
11.6.1 Bean-managed transaction demarcation
The Container must throw the java.lang.IllegalStateException if an instance of a bean
with bean-managed transaction demarcation attempts to invoke the setRollbackOnly() or
getRollbackOnly() method of the javax.ejb.EJBContext interface.
|
void |
TODO_test07_serialTransactions()
11.6.1 Bean-managed transaction demarcation
The Container must allow the enterprise bean instance to serially perform several transactions in a
method.
|
void |
TODO_test08_nestedTransactions()
11.6.1 Bean-managed transaction demarcation
When an instance attempts to start a transaction using the
begin() method of the javax.transaction.UserTransaction
interface while the instance has not committed the previous
transaction, the Container must throw the
javax.transaction.NotSupportedException in the begin() method.
|
void |
TODO_test09_beginWithNoCommit()
11.6.1 Bean-managed transaction demarcation
If a singleton session bean instance starts a transaction in a
business method, it must commit the transaction before the
business method returns.
|
void |
TODO_test10_scenario1_NoneNone()
11.6.1 Bean-managed transaction demarcation
The actions performed by the Container for an instance with bean-managed transaction are summarized
by the following table.
|
void |
TODO_test11_scenario2_T1None()
11.6.1 Bean-managed transaction demarcation
The actions performed by the Container for an instance with bean-managed transaction are summarized
by the following table.
|
namecountTestCases, createTest, createTestName, removePrefix, removePrefix, run, run, runTestMethod, toStringassertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertThat, assertThat, assertTrue, assertTrue, fail, failpublic static final String jndiEJBHomeEntry
protected BeanTxSingletonHome ejbHome
protected BeanTxSingletonObject ejbObject
protected javax.ejb.EJBMetaData ejbMetaData
protected javax.ejb.HomeHandle ejbHomeHandle
protected javax.ejb.Handle ejbHandle
protected Integer ejbPrimaryKey
protected InitialContext initialContext
protected void setUp()
throws Exception
setUp in class NumberedTestCaseExceptionprotected void tearDown()
throws Exception
tearDown in class NumberedTestCaseExceptionpublic void test01_EJBContext_getUserTransaction()
--------------------------------------------------------
Check that a javax.transaction.UserTransaction can be obtained from the javax.ejb.EJBContextpublic void test02_java_comp_UserTransaction()
--------------------------------------------------------
Check that a javax.transaction.UserTransaction can be obtained from the environment entry java:comp/UserTransactionpublic void TODO_test03_EJBContext_setRollbackOnly()
--------------------------------------------------------
Test that setRollbackOnly() throws a java.lang.IllegalStateExceptionpublic void TODO_test04_EJBContext_getRollbackOnly()
--------------------------------------------------------
Test that getRollbackOnly() throws a java.lang.IllegalStateExceptionpublic void test05_singleTransactionCommit()
public void BUG_test06_singleTransactionRollback()
public void TODO_test07_serialTransactions()
public void TODO_test08_nestedTransactions()
public void TODO_test09_beginWithNoCommit()
public void TODO_test10_scenario1_NoneNone()
========================================================================= Container's actions for methods of beans with bean-managed transaction ========================================================================= | IF | AND | THEN scenario | Client's | Transaction currently | Transaction associated | transaction | associated with instance | with the method is ___________|_____________|__________________________|________________________ | | | 1 | none | none | none ___________|_____________|__________________________|________________________ | | | 2 | T1 | none | none ___________|_____________|__________________________|________________________ | | | 3 | none | T2 | T2 ___________|_____________|__________________________|________________________ | | | 4 | T1 | T2 | T2 ___________|_____________|__________________________|________________________If the client request is not associated with a transaction and the instance is not associated with a transaction, the container invokes the instance with an unspecified transaction context.
--------------------------------------------------------
Test scenario 1: none nonepublic void TODO_test11_scenario2_T1None()
========================================================================= Container's actions for methods of beans with bean-managed transaction ========================================================================= | IF | AND | THEN scenario | Client's | Transaction currently | Transaction associated | transaction | associated with instance | with the method is ___________|_____________|__________________________|________________________ | | | 1 | none | none | none ___________|_____________|__________________________|________________________ | | | 2 | T1 | none | none ___________|_____________|__________________________|________________________ | | | 3 | none | T2 | T2 ___________|_____________|__________________________|________________________ | | | 4 | T1 | T2 | T2 ___________|_____________|__________________________|________________________If the client is associated with a transaction T1, and the instance is not associated with a transaction, the container suspends the client's transaction association and invokes the method with an unspecified transaction context. The container resumes the client's ntransaction association (T1) when the method completes.
--------------------------------------------------------
Test scenario 2: T1 noneCopyright © 1999–2016 The Apache Software Foundation. All rights reserved.