You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by an...@apache.org on 2014/07/15 23:55:19 UTC
svn commit: r1610862 [36/44] - in /tomee/tomee/trunk/itests: ./ failover-ejb/
failover-ejb/src/main/java/org/apache/openejb/itest/failover/ejb/ failover/
failover/src/main/java/org/apache/openejb/itest/failover/
failover/src/main/java/org/apache/openej...
Modified: tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulBeanTxTests.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulBeanTxTests.java?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulBeanTxTests.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulBeanTxTests.java Tue Jul 15 21:55:09 2014
@@ -31,23 +31,22 @@ import org.apache.openejb.test.object.Tr
/**
* [1] Should be run as the first test suite of the StatefulTestClients
- *
*/
-public class StatefulBeanTxTests extends org.apache.openejb.test.NamedTestCase{
+public class StatefulBeanTxTests extends org.apache.openejb.test.NamedTestCase {
public final static String jndiEJBHomeEntry = "client/tests/stateful/BeanManagedTransactionTests/EJBHome";
- protected BeanTxStatefulHome ejbHome;
+ protected BeanTxStatefulHome ejbHome;
protected BeanTxStatefulObject ejbObject;
- protected EJBMetaData ejbMetaData;
- protected HomeHandle ejbHomeHandle;
- protected Handle ejbHandle;
- protected Integer ejbPrimaryKey;
+ protected EJBMetaData ejbMetaData;
+ protected HomeHandle ejbHomeHandle;
+ protected Handle ejbHandle;
+ protected Integer ejbPrimaryKey;
protected InitialContext initialContext;
- public StatefulBeanTxTests(){
+ public StatefulBeanTxTests() {
super("Stateful.BeanManagedTransaction.");
}
@@ -57,15 +56,15 @@ public class StatefulBeanTxTests extends
*/
protected void setUp() throws Exception {
- Properties properties = TestManager.getServer().getContextEnvironment();
+ final Properties properties = TestManager.getServer().getContextEnvironment();
//properties.put(Context.SECURITY_PRINCIPAL, "STATEFUL_test00_CLIENT");
//properties.put(Context.SECURITY_CREDENTIALS, "STATEFUL_test00_CLIENT");
initialContext = new InitialContext(properties);
/*[1] Get bean */
- Object obj = initialContext.lookup(jndiEJBHomeEntry);
- ejbHome = (BeanTxStatefulHome)javax.rmi.PortableRemoteObject.narrow( obj, BeanTxStatefulHome.class);
+ final Object obj = initialContext.lookup(jndiEJBHomeEntry);
+ ejbHome = (BeanTxStatefulHome) javax.rmi.PortableRemoteObject.narrow(obj, BeanTxStatefulHome.class);
ejbObject = ejbHome.create("Transaction Bean");
/*[2] Create database table */
@@ -84,7 +83,7 @@ public class StatefulBeanTxTests extends
/**
* <B>11.6.1 Bean-managed transaction demarcation</B>
- * <P>
+ * <p/>
* 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. When an instance uses the javax.trans-action.
@@ -94,24 +93,23 @@ public class StatefulBeanTxTests extends
* responsible for the global coordination of the transaction commit.
* </P>
* <P>--------------------------------------------------------</P>
- * <P>
+ * <p/>
* Check that a javax.transaction.UserTransaction can be obtained from
* the javax.ejb.EJBContext
* </P>
*/
- public void test01_EJBContext_getUserTransaction(){
- try{
- Transaction t = ejbObject.getUserTransaction();
- assertNotNull("UserTransaction is null.", t);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ public void test01_EJBContext_getUserTransaction() {
+ try {
+ final Transaction t = ejbObject.getUserTransaction();
+ assertNotNull("UserTransaction is null.", t);
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
/**
- *
* <B>11.6.1 Bean-managed transaction demarcation</B>
- * <P>
+ * <p/>
* 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. When an instance uses the javax.trans-action.
@@ -121,128 +119,128 @@ public class StatefulBeanTxTests extends
* responsible for the global coordination of the transaction commit.
* </P>
* <P>--------------------------------------------------------</P>
- * <P>
+ * <p/>
* Check that a javax.transaction.UserTransaction can be obtained from
* the environment entry java:comp/UserTransaction
* </P>
*/
- public void test02_java_comp_UserTransaction(){
- try{
- Transaction t = ejbObject.jndiUserTransaction();
+ public void test02_java_comp_UserTransaction() {
+ try {
+ final Transaction t = ejbObject.jndiUserTransaction();
assertNotNull("UserTransaction is null. Could not retreive a UserTransaction from the bean's JNDI namespace.", t);
- } catch (Exception e){
- fail("Could not retreive a UserTransaction from the bean's JNDI namespace. Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Could not retreive a UserTransaction from the bean's JNDI namespace. Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
/**
* <B>11.6.1 Bean-managed transaction demarcation</B>
- * <P>
+ * <p/>
* 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.
* </P>
* <P>--------------------------------------------------------</P>
- * <P>
+ * <p/>
* Test that setRollbackOnly() throws a java.lang.IllegalStateException
* </P>
*/
- public void TODO_test03_EJBContext_setRollbackOnly(){
- try{
+ public void TODO_test03_EJBContext_setRollbackOnly() {
+ try {
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
/**
* <B>11.6.1 Bean-managed transaction demarcation</B>
- * <P>
+ * <p/>
* 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.
* </P>
* <P>--------------------------------------------------------</P>
- * <P>
+ * <p/>
* Test that getRollbackOnly() throws a java.lang.IllegalStateException
* </P>
*/
- public void TODO_test04_EJBContext_getRollbackOnly(){
- try{
+ public void TODO_test04_EJBContext_getRollbackOnly() {
+ try {
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
/**
*
*/
- public void test05_singleTransactionCommit(){
- try{
- Account expected = new Account("123-45-6789","Joe","Cool",40000);
+ public void test05_singleTransactionCommit() {
+ try {
+ final Account expected = new Account("123-45-6789", "Joe", "Cool", 40000);
Account actual = new Account();
ejbObject.openAccount(expected, new Boolean(false));
- actual = ejbObject.retreiveAccount( expected.getSsn() );
+ actual = ejbObject.retreiveAccount(expected.getSsn());
- assertNotNull( "The transaction was not commited. The record is null", actual );
- assertEquals( "The transaction was not commited cleanly.", expected, actual );
- } catch (RollbackException re){
- fail("Transaction was rolledback. Received Exception "+re.getClass()+ " : "+re.getMessage());
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ assertNotNull("The transaction was not commited. The record is null", actual);
+ assertEquals("The transaction was not commited cleanly.", expected, actual);
+ } catch (final RollbackException re) {
+ fail("Transaction was rolledback. Received Exception " + re.getClass() + " : " + re.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
/**
- * This test does work for the IntraVM Server, but it fails on
+ * This test does work for the IntraVM Server, but it fails on
* the Remote Server. For some reason, when the RollbackException is
* sent to the client, the server blocks.
*/
- public void BUG_test06_singleTransactionRollback(){
- Account expected = new Account("234-56-7890","Charlie","Brown", 20000);
- Account actual = new Account();
+ public void BUG_test06_singleTransactionRollback() {
+ final Account expected = new Account("234-56-7890", "Charlie", "Brown", 20000);
+ final Account actual = new Account();
// Try and add the account in a transaction. This should fail and
// throw a RollbackException
- try{
+ try {
ejbObject.openAccount(expected, new Boolean(true));
- fail( "A javax.transaction.RollbackException should have been thrown." );
- } catch (RollbackException re){
+ fail("A javax.transaction.RollbackException should have been thrown.");
+ } catch (final RollbackException re) {
// Good.
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
-
- //// Now check that the account really wasn't added.
- //try{
- // actual = ejbObject.retreiveAccount( expected.getSsn() );
- // //assertTrue( "The transaction was commited when it should have been rolledback.", !expected.equals(actual) );
- //} catch (Exception e){
- // fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
- //}
+
+ //// Now check that the account really wasn't added.
+ //try{
+ // actual = ejbObject.retreiveAccount( expected.getSsn() );
+ // //assertTrue( "The transaction was commited when it should have been rolledback.", !expected.equals(actual) );
+ //} catch (Exception e){
+ // fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ //}
}
/**
* <B>11.6.1 Bean-managed transaction demarcation</B>
- * <P>
+ * <p/>
* The Container must allow the enterprise bean instance to serially perform several transactions in a
* method.
* </P>
*/
- public void TODO_test07_serialTransactions(){
- try{
+ public void TODO_test07_serialTransactions() {
+ try {
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
/**
* <B>11.6.1 Bean-managed transaction demarcation</B>
- * <P>
+ * <p/>
* 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
@@ -250,17 +248,17 @@ public class StatefulBeanTxTests extends
* javax.transaction.NotSupportedException in the begin() method.
* </P>
*/
- public void TODO_test08_nestedTransactions(){
- try{
+ public void TODO_test08_nestedTransactions() {
+ try {
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
/**
* <B>11.6.1 Bean-managed transaction demarcation</B>
- * <P>
+ * <p/>
* In the case of a stateful session bean, it is possible that the
* business method that started a transaction completes without
* committing or rolling back the transaction. In such a case, the
@@ -271,17 +269,17 @@ public class StatefulBeanTxTests extends
* method in this transaction context.
* </P>
*/
- public void TODO_test09_methodSpanningTransactions(){
- try{
+ public void TODO_test09_methodSpanningTransactions() {
+ try {
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
/**
* <B>11.6.1 Bean-managed transaction demarcation</B>
- * <P>
+ * <p/>
* The actions performed by the Container for an instance with bean-managed transaction are summarized
* by the following table. T1 is a transaction associated with a client request, T2 is a transaction that is cur-rently
* associated with the instance (i.e. a transaction that was started but not completed by a previous
@@ -291,46 +289,46 @@ public class StatefulBeanTxTests extends
* =========================================================================
* 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
+ * <p/>
+ * | IF | AND | THEN
+ * scenario | Client's | Transaction currently | Transaction associated
+ * | transaction | associated with instance | with the method is
+ * ___________|_____________|__________________________|________________________
+ * | | |
+ * 1 | none | none | none
* ___________|_____________|__________________________|________________________
- * | | |
- * 1 | none | none | none
+ * | | |
+ * 2 | T1 | none | none
* ___________|_____________|__________________________|________________________
- * | | |
- * 2 | T1 | none | none
+ * | | |
+ * 3 | none | T2 | T2
* ___________|_____________|__________________________|________________________
- * | | |
- * 3 | none | T2 | T2
- * ___________|_____________|__________________________|________________________
- * | | |
- * 4 | T1 | T2 | T2
+ * | | |
+ * 4 | T1 | T2 | T2
* ___________|_____________|__________________________|________________________
* </PRE>
- * <P>
+ * <p/>
* 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.
* </P>
* <P>--------------------------------------------------------</P>
- * <P>
+ * <p/>
* Test scenario 1: none none<BR>
* If the client's transaction is none and the transaction currently
* associated with instance none then the transaction associated with the method is none.
* </P>
*/
- public void TODO_test10_scenario1_NoneNone(){
- try{
+ public void TODO_test10_scenario1_NoneNone() {
+ try {
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
/**
* <B>11.6.1 Bean-managed transaction demarcation</B>
- * <P>
+ * <p/>
* The actions performed by the Container for an instance with bean-managed transaction are summarized
* by the following table. T1 is a transaction associated with a client request, T2 is a transaction that is cur-rently
* associated with the instance (i.e. a transaction that was started but not completed by a previous
@@ -340,46 +338,46 @@ public class StatefulBeanTxTests extends
* =========================================================================
* 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
+ * <p/>
+ * | IF | AND | THEN
+ * scenario | Client's | Transaction currently | Transaction associated
+ * | transaction | associated with instance | with the method is
+ * ___________|_____________|__________________________|________________________
+ * | | |
+ * 1 | none | none | none
* ___________|_____________|__________________________|________________________
- * | | |
- * 1 | none | none | none
+ * | | |
+ * 2 | T1 | none | none
* ___________|_____________|__________________________|________________________
- * | | |
- * 2 | T1 | none | none
+ * | | |
+ * 3 | none | T2 | T2
* ___________|_____________|__________________________|________________________
- * | | |
- * 3 | none | T2 | T2
- * ___________|_____________|__________________________|________________________
- * | | |
- * 4 | T1 | T2 | T2
+ * | | |
+ * 4 | T1 | T2 | T2
* ___________|_____________|__________________________|________________________
* </PRE>
- * <P>
+ * <p/>
* 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 transaction association
* (T1) when the method completes.
* </P>
* <P>--------------------------------------------------------</P>
- * <P>
+ * <p/>
* Test scenario 2: T1 none<BR>
* </P>
*/
- public void TODO_test11_scenario2_T1None(){
- try{
+ public void TODO_test11_scenario2_T1None() {
+ try {
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
/**
* <B>11.6.1 Bean-managed transaction demarcation</B>
- * <P>
+ * <p/>
* The actions performed by the Container for an instance with bean-managed transaction are summarized
* by the following table. T1 is a transaction associated with a client request, T2 is a transaction that is cur-rently
* associated with the instance (i.e. a transaction that was started but not completed by a previous
@@ -389,45 +387,45 @@ public class StatefulBeanTxTests extends
* =========================================================================
* 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
+ * <p/>
+ * | 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
+ * | | |
+ * 2 | T1 | none | none
* ___________|_____________|__________________________|________________________
- * | | |
- * 3 | none | T2 | T2
+ * | | |
+ * 3 | none | T2 | T2
* ___________|_____________|__________________________|________________________
- * | | |
- * 4 | T1 | T2 | T2
+ * | | |
+ * 4 | T1 | T2 | T2
* ___________|_____________|__________________________|________________________
* </PRE>
- * <P>
+ * <p/>
* If the client request is not associated with a transaction and the instance is already associated
* with a transaction T2, the container invokes the instance with the transaction that is associated
* with the instance (T2). This case can never happen for a stateless Session Bean.
* </P>
* <P>--------------------------------------------------------</P>
- * <P>
+ * <p/>
* Test scenario 3: none T2<BR>
* </P>
*/
- public void TODO_test12_scenario3_NoneT2(){
- try{
+ public void TODO_test12_scenario3_NoneT2() {
+ try {
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
/**
* <B>11.6.1 Bean-managed transaction demarcation</B>
- * <P>
+ * <p/>
* The actions performed by the Container for an instance with bean-managed transaction are summarized
* by the following table. T1 is a transaction associated with a client request, T2 is a transaction that is cur-rently
* associated with the instance (i.e. a transaction that was started but not completed by a previous
@@ -437,25 +435,25 @@ public class StatefulBeanTxTests extends
* =========================================================================
* 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
+ * <p/>
+ * | 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
+ * | | |
+ * 2 | T1 | none | none
* ___________|_____________|__________________________|________________________
- * | | |
- * 3 | none | T2 | T2
+ * | | |
+ * 3 | none | T2 | T2
* ___________|_____________|__________________________|________________________
- * | | |
- * 4 | T1 | T2 | T2
+ * | | |
+ * 4 | T1 | T2 | T2
* ___________|_____________|__________________________|________________________
* </PRE>
- * <P>
+ * <p/>
* If the client is associated with a transaction T1, and the instance is already associated with a
* transaction T2, the container suspends the client's transaction association and invokes the
* method with the transaction context that is associated with the instance (T2). The container
@@ -463,15 +461,15 @@ public class StatefulBeanTxTests extends
* never happen for a stateless Session Bean.
* </P>
* <P>--------------------------------------------------------</P>
- * <P>
+ * <p/>
* Test scenario 4: T1 T2<BR>
* </P>
*/
- public void TODO_test13_scenario4_T1T2(){
- try{
+ public void TODO_test13_scenario4_T1T2() {
+ try {
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
}
Modified: tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulContextLookupTests.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulContextLookupTests.java?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulContextLookupTests.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulContextLookupTests.java Tue Jul 15 21:55:09 2014
@@ -21,21 +21,20 @@ import org.apache.openejb.test.TestFailu
/**
* [4] Should be run as the fourth test suite of the StatefulTestClients
- *
*/
-public class StatefulContextLookupTests extends StatefulTestClient{
+public class StatefulContextLookupTests extends StatefulTestClient {
- protected EncStatefulHome ejbHome;
+ protected EncStatefulHome ejbHome;
protected EncStatefulObject ejbObject;
- public StatefulContextLookupTests(){
+ public StatefulContextLookupTests() {
super("EJB_CONTEXT_LOOKUP.");
}
- protected void setUp() throws Exception{
+ protected void setUp() throws Exception {
super.setUp();
- Object obj = initialContext.lookup("client/tests/stateful/ContextLookupStatefulBean");
- ejbHome = (EncStatefulHome)javax.rmi.PortableRemoteObject.narrow( obj, EncStatefulHome.class);
+ final Object obj = initialContext.lookup("client/tests/stateful/ContextLookupStatefulBean");
+ ejbHome = (EncStatefulHome) javax.rmi.PortableRemoteObject.narrow(obj, EncStatefulHome.class);
ejbObject = ejbHome.create("Enc Bean");
/*[2] Create database table */
@@ -50,7 +49,7 @@ public class StatefulContextLookupTests
try {
/*[1] Drop database table */
TestManager.getDatabase().dropEntityTable();
- } catch (Exception e){
+ } catch (final Exception e) {
throw e;
} finally {
super.tearDown();
@@ -58,172 +57,172 @@ public class StatefulContextLookupTests
}
public void test01_lookupStringEntry() {
- try{
+ try {
ejbObject.lookupStringEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test02_lookupDoubleEntry() {
- try{
+ try {
ejbObject.lookupDoubleEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test03_lookupLongEntry() {
- try{
+ try {
ejbObject.lookupLongEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test04_lookupFloatEntry() {
- try{
+ try {
ejbObject.lookupFloatEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test05_lookupIntegerEntry() {
- try{
+ try {
ejbObject.lookupIntegerEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test06_lookupShortEntry() {
- try{
+ try {
ejbObject.lookupShortEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test07_lookupBooleanEntry() {
- try{
+ try {
ejbObject.lookupBooleanEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test08_lookupByteEntry() {
- try{
+ try {
ejbObject.lookupByteEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test09_lookupCharacterEntry() {
- try{
+ try {
ejbObject.lookupCharacterEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test10_lookupEntityBean() {
- try{
+ try {
ejbObject.lookupEntityBean();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test11_lookupStatefulBean() {
- try{
+ try {
ejbObject.lookupStatefulBean();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test12_lookupStatelessBean() {
- try{
+ try {
ejbObject.lookupStatelessBean();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test13_lookupResource() {
- try{
+ try {
ejbObject.lookupResource();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
-
+
public void test14_lookupPersistenceUnit() {
- try{
+ try {
ejbObject.lookupPersistenceUnit();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test15_lookupPersistenceContext() {
- try{
+ try {
ejbObject.lookupPersistenceContext();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test18_lookupSessionContext() {
- try{
+ try {
ejbObject.lookupSessionContext();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test23_lookupJMSConnectionFactory() {
- try{
+ try {
ejbObject.lookupJMSConnectionFactory();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
}
Modified: tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulEjbHomeTests.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulEjbHomeTests.java?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulEjbHomeTests.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulEjbHomeTests.java Tue Jul 15 21:55:09 2014
@@ -21,38 +21,37 @@ import javax.ejb.RemoveException;
/**
* [3] Should be run as the third test suite of the BasicStatefulTestClients
- *
*/
public class StatefulEjbHomeTests extends BasicStatefulTestClient {
- public StatefulEjbHomeTests(){
+ public StatefulEjbHomeTests() {
super("EJBHome.");
}
- protected void setUp() throws Exception{
+ protected void setUp() throws Exception {
super.setUp();
- Object obj = initialContext.lookup("client/tests/stateful/BasicStatefulHome");
- ejbHome = (BasicStatefulHome)javax.rmi.PortableRemoteObject.narrow( obj, BasicStatefulHome.class);
+ final Object obj = initialContext.lookup("client/tests/stateful/BasicStatefulHome");
+ ejbHome = (BasicStatefulHome) javax.rmi.PortableRemoteObject.narrow(obj, BasicStatefulHome.class);
}
//===============================
// Test ejb home methods
//
- public void test01_getEJBMetaData(){
- try{
- EJBMetaData ejbMetaData = ejbHome.getEJBMetaData();
- assertNotNull( "The EJBMetaData is null", ejbMetaData );
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ public void test01_getEJBMetaData() {
+ try {
+ final EJBMetaData ejbMetaData = ejbHome.getEJBMetaData();
+ assertNotNull("The EJBMetaData is null", ejbMetaData);
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test02_getHomeHandle(){
- try{
+ public void test02_getHomeHandle() {
+ try {
ejbHomeHandle = ejbHome.getHomeHandle();
- assertNotNull( "The HomeHandle is null", ejbHomeHandle );
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ assertNotNull("The HomeHandle is null", ejbHomeHandle);
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
@@ -61,14 +60,14 @@ public class StatefulEjbHomeTests extend
* 5.3.2 Removing a session object
* A client may remove a session object using the remove() method on the javax.ejb.EJBObject
* interface, or the remove(Handle handle) method of the javax.ejb.EJBHome interface.
- *
+ * <p/>
* Because session objects do not have primary keys that are accessible to clients, invoking the
* javax.ejb.EJBHome.remove(Object primaryKey) method on a session results in the
* javax.ejb.RemoveException.
- *
+ * <p/>
* ------------------------------------
* 5.5 Session object identity
- *
+ * <p/>
* Session objects are intended to be private resources used only by the
* client that created them. For this reason, session objects, from the
* client's perspective, appear anonymous. In contrast to entity objects,
@@ -79,22 +78,22 @@ public class StatefulEjbHomeTests extend
* method is invoked on a EJBMetaData object for a Session bean, the method throws
* the java.lang.RuntimeException.
* ------------------------------------
- *
+ * <p/>
* Sections 5.3.2 and 5.5 conflict. 5.3.2 says to throw javax.ejb.RemoveException, 5.5 says to
* throw java.rmi.RemoteException.
- *
+ * <p/>
* For now, we are going with java.rmi.RemoteException.
*/
- public void test03_removeByPrimaryKey(){
- try{
+ public void test03_removeByPrimaryKey() {
+ try {
ejbHome.remove("primaryKey");
- } catch (RemoveException e){
- assertTrue( true );
+ } catch (final RemoveException e) {
+ assertTrue(true);
return;
- } catch (Exception e){
+ } catch (final Exception e) {
fail("Received Exception " + e.getClass() + " instead of javax.ejb.RemoveException : " + e.getMessage());
}
- assertTrue("javax.ejb.RemoveException should have been thrown", false );
+ assertTrue("javax.ejb.RemoveException should have been thrown", false);
}
//
// Test ejb home methods
Modified: tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulEjbMetaDataTests.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulEjbMetaDataTests.java?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulEjbMetaDataTests.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulEjbMetaDataTests.java Tue Jul 15 21:55:09 2014
@@ -20,46 +20,45 @@ import javax.ejb.EJBHome;
/**
* [8] Should be run as the eigth test suite of the BasicStatefulTestClients
- *
*/
-public class StatefulEjbMetaDataTests extends BasicStatefulTestClient{
+public class StatefulEjbMetaDataTests extends BasicStatefulTestClient {
- public StatefulEjbMetaDataTests(){
+ public StatefulEjbMetaDataTests() {
super("EJBMetaData.");
}
- protected void setUp() throws Exception{
+ protected void setUp() throws Exception {
super.setUp();
- Object obj = initialContext.lookup("client/tests/stateful/BasicStatefulHome");
- ejbHome = (BasicStatefulHome)javax.rmi.PortableRemoteObject.narrow( obj, BasicStatefulHome.class);
+ final Object obj = initialContext.lookup("client/tests/stateful/BasicStatefulHome");
+ ejbHome = (BasicStatefulHome) javax.rmi.PortableRemoteObject.narrow(obj, BasicStatefulHome.class);
ejbMetaData = ejbHome.getEJBMetaData();
}
//=================================
// Test meta data methods
//
- public void test01_getEJBHome(){
- try{
- EJBHome home = ejbMetaData.getEJBHome();
- assertNotNull( "The EJBHome is null", home );
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ public void test01_getEJBHome() {
+ try {
+ final EJBHome home = ejbMetaData.getEJBHome();
+ assertNotNull("The EJBHome is null", home);
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test02_getHomeInterfaceClass(){
- try{
- Class clazz = ejbMetaData.getHomeInterfaceClass();
- assertNotNull( "The Home Interface class is null", clazz );
- assertEquals(clazz , BasicStatefulHome.class);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ public void test02_getHomeInterfaceClass() {
+ try {
+ final Class clazz = ejbMetaData.getHomeInterfaceClass();
+ assertNotNull("The Home Interface class is null", clazz);
+ assertEquals(clazz, BasicStatefulHome.class);
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
/**
* 5.5 Session object identity
- *
+ * <p/>
* Session objects are intended to be private resources used only by the
* client that created them. For this reason, session objects, from the
* client's perspective, appear anonymous. In contrast to entity objects,
@@ -70,42 +69,42 @@ public class StatefulEjbMetaDataTests ex
* method is invoked on a EJBMetaData object for a Session bean, the method throws
* the java.lang.RuntimeException.
*/
- public void test03_getPrimaryKeyClass(){
- try{
- Class clazz = ejbMetaData.getPrimaryKeyClass();
- assertNull("Should not return a primary key. Method should throw an java.lang.RuntimeException", clazz );
- } catch (UnsupportedOperationException e){
- assertTrue( true );
+ public void test03_getPrimaryKeyClass() {
+ try {
+ final Class clazz = ejbMetaData.getPrimaryKeyClass();
+ assertNull("Should not return a primary key. Method should throw an java.lang.RuntimeException", clazz);
+ } catch (final UnsupportedOperationException e) {
+ assertTrue(true);
return;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
- assertTrue( "Method should throw an java.lang.RuntimeException", false );
+ assertTrue("Method should throw an java.lang.RuntimeException", false);
}
- public void test04_getRemoteInterfaceClass(){
- try{
- Class clazz = ejbMetaData.getRemoteInterfaceClass();
- assertNotNull( "The Remote Interface class is null", clazz );
- assertEquals(clazz , BasicStatefulObject.class);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ public void test04_getRemoteInterfaceClass() {
+ try {
+ final Class clazz = ejbMetaData.getRemoteInterfaceClass();
+ assertNotNull("The Remote Interface class is null", clazz);
+ assertEquals(clazz, BasicStatefulObject.class);
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test05_isSession(){
- try{
- assertTrue( "EJBMetaData says this is not a session bean", ejbMetaData.isSession() );
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ public void test05_isSession() {
+ try {
+ assertTrue("EJBMetaData says this is not a session bean", ejbMetaData.isSession());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test06_isStatelessSession(){
- try{
- assertTrue( "EJBMetaData says this is a stateless session bean", !ejbMetaData.isStatelessSession() );
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ public void test06_isStatelessSession() {
+ try {
+ assertTrue("EJBMetaData says this is a stateless session bean", !ejbMetaData.isStatelessSession());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
//
Modified: tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulEjbObjectTests.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulEjbObjectTests.java?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulEjbObjectTests.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulEjbObjectTests.java Tue Jul 15 21:55:09 2014
@@ -22,18 +22,17 @@ import javax.ejb.EJBHome;
/**
* [4] Should be run as the fourth test suite of the BasicStatefulTestClients
- *
*/
-public class StatefulEjbObjectTests extends BasicStatefulTestClient{
+public class StatefulEjbObjectTests extends BasicStatefulTestClient {
- public StatefulEjbObjectTests(){
+ public StatefulEjbObjectTests() {
super("EJBObject.");
}
- protected void setUp() throws Exception{
+ protected void setUp() throws Exception {
super.setUp();
- Object obj = initialContext.lookup("client/tests/stateful/BasicStatefulHome");
- ejbHome = (BasicStatefulHome)javax.rmi.PortableRemoteObject.narrow( obj, BasicStatefulHome.class);
+ final Object obj = initialContext.lookup("client/tests/stateful/BasicStatefulHome");
+ ejbHome = (BasicStatefulHome) javax.rmi.PortableRemoteObject.narrow(obj, BasicStatefulHome.class);
ejbObject = ejbHome.createObject("Second Bean");
}
@@ -45,35 +44,35 @@ public class StatefulEjbObjectTests exte
//===============================
// Test ejb object methods
//
- public void test01_getHandle(){
- try{
+ public void test01_getHandle() {
+ try {
ejbHandle = ejbObject.getHandle();
- assertNotNull( "The Handle is null", ejbHandle );
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ assertNotNull("The Handle is null", ejbHandle);
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test02_isIdentical(){
- try{
- assertTrue( "The EJBObjects are not equal", ejbObject.isIdentical(ejbObject) );
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ public void test02_isIdentical() {
+ try {
+ assertTrue("The EJBObjects are not equal", ejbObject.isIdentical(ejbObject));
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test03_getEjbHome(){
- try{
- EJBHome home = ejbObject.getEJBHome();
- assertNotNull( "The EJBHome is null", home );
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ public void test03_getEjbHome() {
+ try {
+ final EJBHome home = ejbObject.getEJBHome();
+ assertNotNull("The EJBHome is null", home);
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
/**
* 5.5 Session object identity
- *
+ * <p/>
* Session objects are intended to be private resources used only by the
* client that created them. For this reason, session objects, from the
* client's perspective, appear anonymous. In contrast to entity objects,
@@ -84,14 +83,14 @@ public class StatefulEjbObjectTests exte
* method is invoked on a EJBMetaData object for a Session bean, the method throws
* the java.lang.RuntimeException.
*/
- public void test04_getPrimaryKey(){
- try{
- Object key = ejbObject.getPrimaryKey();
- } catch (java.rmi.RemoteException e){
+ public void test04_getPrimaryKey() {
+ try {
+ final Object key = ejbObject.getPrimaryKey();
+ } catch (final java.rmi.RemoteException e) {
assertTrue(true);
return;
- } catch (Exception e){
- fail("A RuntimeException should have been thrown. Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("A RuntimeException should have been thrown. Received Exception " + e.getClass() + " : " + e.getMessage());
}
fail("A RuntimeException should have been thrown.");
}
@@ -99,31 +98,31 @@ public class StatefulEjbObjectTests exte
//
// Test ejb remoce methods
//===============================
- public void test05_remove(){
+ public void test05_remove() {
String str = null;
try {
str = ejbObject.remove("Hello");
- } catch (RemoteException e) {
+ } catch (final RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
- assertEquals("Hello",str);
+ assertEquals("Hello", str);
}
- public void test06_remove(){
- try{
+ public void test06_remove() {
+ try {
ejbObject.remove();
- try{
+ try {
ejbObject.businessMethod("Should throw an exception");
- assertTrue( "Calling business method after removing the EJBObject does not throw an exception", false );
- } catch (Exception e){
- assertTrue( true );
+ assertTrue("Calling business method after removing the EJBObject does not throw an exception", false);
+ } catch (final Exception e) {
+ assertTrue(true);
return;
}
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
-
+
}
Modified: tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulFieldInjectionTests.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulFieldInjectionTests.java?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulFieldInjectionTests.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulFieldInjectionTests.java Tue Jul 15 21:55:09 2014
@@ -21,21 +21,20 @@ import org.apache.openejb.test.TestFailu
/**
* [4] Should be run as the fourth test suite of the StatefulTestClients
- *
*/
-public class StatefulFieldInjectionTests extends StatefulTestClient{
+public class StatefulFieldInjectionTests extends StatefulTestClient {
- protected EncStatefulHome ejbHome;
+ protected EncStatefulHome ejbHome;
protected EncStatefulObject ejbObject;
- public StatefulFieldInjectionTests(){
+ public StatefulFieldInjectionTests() {
super("EJB_CONTEXT_LOOKUP.");
}
- protected void setUp() throws Exception{
+ protected void setUp() throws Exception {
super.setUp();
- Object obj = initialContext.lookup("client/tests/stateful/FieldInjectionStatefulBean");
- ejbHome = (EncStatefulHome)javax.rmi.PortableRemoteObject.narrow( obj, EncStatefulHome.class);
+ final Object obj = initialContext.lookup("client/tests/stateful/FieldInjectionStatefulBean");
+ ejbHome = (EncStatefulHome) javax.rmi.PortableRemoteObject.narrow(obj, EncStatefulHome.class);
ejbObject = ejbHome.create("Enc Bean");
/*[2] Create database table */
@@ -50,7 +49,7 @@ public class StatefulFieldInjectionTests
try {
/*[1] Drop database table */
TestManager.getDatabase().dropEntityTable();
- } catch (Exception e){
+ } catch (final Exception e) {
throw e;
} finally {
super.tearDown();
@@ -58,232 +57,232 @@ public class StatefulFieldInjectionTests
}
public void test01_lookupStringEntry() {
- try{
+ try {
ejbObject.lookupStringEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test02_lookupDoubleEntry() {
- try{
+ try {
ejbObject.lookupDoubleEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test03_lookupLongEntry() {
- try{
+ try {
ejbObject.lookupLongEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test04_lookupFloatEntry() {
- try{
+ try {
ejbObject.lookupFloatEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test05_lookupIntegerEntry() {
- try{
+ try {
ejbObject.lookupIntegerEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test06_lookupShortEntry() {
- try{
+ try {
ejbObject.lookupShortEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test07_lookupBooleanEntry() {
- try{
+ try {
ejbObject.lookupBooleanEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test08_lookupByteEntry() {
- try{
+ try {
ejbObject.lookupByteEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test09_lookupCharacterEntry() {
- try{
+ try {
ejbObject.lookupCharacterEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test10_lookupEntityBean() {
- try{
+ try {
ejbObject.lookupEntityBean();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test11_lookupStatefulBean() {
- try{
+ try {
ejbObject.lookupStatefulBean();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test12_lookupStatelessBean() {
- try{
+ try {
ejbObject.lookupStatelessBean();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test13_lookupResource() {
- try{
+ try {
ejbObject.lookupResource();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test14_lookupPersistenceUnit() {
- try{
+ try {
ejbObject.lookupPersistenceUnit();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test15_lookupPersistenceContext() {
- try{
+ try {
ejbObject.lookupPersistenceContext();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test18_lookupSessionContext() {
- try{
+ try {
ejbObject.lookupSessionContext();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
-
+
public void test19_lookupStatelessBusinessLocal() {
- try{
+ try {
ejbObject.lookupStatelessBusinessLocal();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test20_lookupStatelessBusinessRemote() {
- try{
+ try {
ejbObject.lookupStatelessBusinessRemote();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test21_lookupStatefulBusinessLocal() {
- try{
+ try {
ejbObject.lookupStatefulBusinessLocal();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test22_lookupStatefulBusinessRemote() {
- try{
+ try {
ejbObject.lookupStatefulBusinessRemote();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test23_lookupJMSConnectionFactory() {
- try{
+ try {
ejbObject.lookupJMSConnectionFactory();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test24_lookupStatefulBusinessLocalBean() {
- try{
+ try {
ejbObject.lookupStatefulBusinessLocalBean();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test25_lookupStatelessBusinessLocalBesn() {
- try{
+ try {
ejbObject.lookupStatelessBusinessLocalBean();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
Modified: tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulHandleTests.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulHandleTests.java?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulHandleTests.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulHandleTests.java Tue Jul 15 21:55:09 2014
@@ -20,18 +20,17 @@ import javax.ejb.EJBObject;
/**
* [7] Should be run as the seventh test suite of the BasicStatefulTestClients
- *
*/
-public class StatefulHandleTests extends BasicStatefulTestClient{
+public class StatefulHandleTests extends BasicStatefulTestClient {
- public StatefulHandleTests(){
+ public StatefulHandleTests() {
super("Handle.");
}
- protected void setUp() throws Exception{
+ protected void setUp() throws Exception {
super.setUp();
- Object obj = initialContext.lookup("client/tests/stateful/BasicStatefulHome");
- ejbHome = (BasicStatefulHome)javax.rmi.PortableRemoteObject.narrow( obj, BasicStatefulHome.class);
+ final Object obj = initialContext.lookup("client/tests/stateful/BasicStatefulHome");
+ ejbHome = (BasicStatefulHome) javax.rmi.PortableRemoteObject.narrow(obj, BasicStatefulHome.class);
ejbObject = ejbHome.createObject("Fourth Bean");
ejbHandle = ejbObject.getHandle();
}
@@ -39,34 +38,35 @@ public class StatefulHandleTests extends
//=================================
// Test handle methods
//
- public void test01_getEJBObject(){
+ public void test01_getEJBObject() {
- try{
- EJBObject object = ejbHandle.getEJBObject();
- assertNotNull( "The EJBObject is null", object );
+ try {
+ final EJBObject object = ejbHandle.getEJBObject();
+ assertNotNull("The EJBObject is null", object);
// Wait until isIdentical is working.
//assertTrue("EJBObjects are not identical", object.isIdentical(ejbObject));
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
+
/**
* This remove method of the EJBHome is placed hear as it
* is more a test on the handle then on the remove method
* itself.
*/
- public void test02_EJBHome_remove(){
- try{
+ public void test02_EJBHome_remove() {
+ try {
ejbHome.remove(ejbHandle);
- try{
+ try {
ejbObject.businessMethod("Should throw an exception");
- assertTrue( "Calling business method after removing the EJBObject does not throw an exception", false );
- } catch (Exception e){
- assertTrue( true );
+ assertTrue("Calling business method after removing the EJBObject does not throw an exception", false);
+ } catch (final Exception e) {
+ assertTrue(true);
return;
}
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
//
Modified: tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulHomeHandleTests.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulHomeHandleTests.java?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulHomeHandleTests.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulHomeHandleTests.java Tue Jul 15 21:55:09 2014
@@ -20,30 +20,29 @@ import javax.ejb.EJBHome;
/**
* [6] Should be run as the sixth test suite of the BasicStatefulTestClients
- *
*/
-public class StatefulHomeHandleTests extends BasicStatefulTestClient{
+public class StatefulHomeHandleTests extends BasicStatefulTestClient {
- public StatefulHomeHandleTests(){
+ public StatefulHomeHandleTests() {
super("HomeHandle.");
}
- protected void setUp() throws Exception{
+ protected void setUp() throws Exception {
super.setUp();
- Object obj = initialContext.lookup("client/tests/stateful/BasicStatefulHome");
- ejbHome = (BasicStatefulHome)javax.rmi.PortableRemoteObject.narrow( obj, BasicStatefulHome.class);
+ final Object obj = initialContext.lookup("client/tests/stateful/BasicStatefulHome");
+ ejbHome = (BasicStatefulHome) javax.rmi.PortableRemoteObject.narrow(obj, BasicStatefulHome.class);
ejbHomeHandle = ejbHome.getHomeHandle();
}
-
+
//=================================
// Test home handle methods
//
- public void test01_getEJBHome(){
- try{
- EJBHome home = ejbHomeHandle.getEJBHome();
- assertNotNull( "The EJBHome is null", home );
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ public void test01_getEJBHome() {
+ try {
+ final EJBHome home = ejbHomeHandle.getEJBHome();
+ assertNotNull("The EJBHome is null", home);
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
//
Modified: tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulHomeIntfcTests.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulHomeIntfcTests.java?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulHomeIntfcTests.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulHomeIntfcTests.java Tue Jul 15 21:55:09 2014
@@ -19,29 +19,28 @@ package org.apache.openejb.test.stateful
/**
* [2] Should be run as the second test suite of the BasicStatefulTestClients
- *
*/
-public class StatefulHomeIntfcTests extends BasicStatefulTestClient{
+public class StatefulHomeIntfcTests extends BasicStatefulTestClient {
- public StatefulHomeIntfcTests(){
+ public StatefulHomeIntfcTests() {
super("HomeIntfc.");
}
-
- protected void setUp() throws Exception{
+
+ protected void setUp() throws Exception {
super.setUp();
- Object obj = initialContext.lookup("client/tests/stateful/BasicStatefulHome");
- ejbHome = (BasicStatefulHome)javax.rmi.PortableRemoteObject.narrow( obj, BasicStatefulHome.class);
+ final Object obj = initialContext.lookup("client/tests/stateful/BasicStatefulHome");
+ ejbHome = (BasicStatefulHome) javax.rmi.PortableRemoteObject.narrow(obj, BasicStatefulHome.class);
}
-
+
//===============================
// Test home interface methods
//
- public void test01_create(){
- try{
+ public void test01_create() {
+ try {
ejbObject = ejbHome.createObject("First Bean");
assertNotNull("The EJBObject is null", ejbObject);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
//
Modified: tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulInterceptorTests.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulInterceptorTests.java?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulInterceptorTests.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulInterceptorTests.java Tue Jul 15 21:55:09 2014
@@ -35,10 +35,10 @@ public class StatefulInterceptorTests ex
protected void setUp() throws Exception {
super.setUp();
- Object obj = initialContext.lookup("BasicStatefulInterceptedBusinessRemote");
+ final Object obj = initialContext.lookup("BasicStatefulInterceptedBusinessRemote");
assertNotNull("The object is null", obj);
remoteInterceptor = (BasicStatefulInterceptedRemote) javax.rmi.PortableRemoteObject.narrow(obj,
- BasicStatefulInterceptedRemote.class);
+ BasicStatefulInterceptedRemote.class);
assertNotNull("Remote interceptor is null", remoteInterceptor);
}
@@ -49,22 +49,22 @@ public class StatefulInterceptorTests ex
super.tearDown();
}
-
+
/**
* Invokes a business method which is to be intercepted by class, in-bean and at method level.
*/
public void test01_interceptorChaining() {
- String reverseMe = "Intercept";
- String reversedString = remoteInterceptor.reverse(reverseMe);
+ final String reverseMe = "Intercept";
+ final String reversedString = remoteInterceptor.reverse(reverseMe);
// verifying InvocationContext.procced()
assertEquals("tpecretnI", reversedString);
-
- Map contextData = remoteInterceptor.getContextData();
+
+ final Map contextData = remoteInterceptor.getContextData();
// verifying that inBeanInterceptor indeed intercepted this method. This cannot be excluded at all.
assertNotNull(contextData.containsKey("reverse"));
-
- Map innerMap = (Map) contextData.get("reverse");
- ArrayList interceptorsList = (ArrayList) innerMap.get("INTERCEPTORS");
+
+ final Map innerMap = (Map) contextData.get("reverse");
+ final ArrayList interceptorsList = (ArrayList) innerMap.get("INTERCEPTORS");
// verifying interceptor chaining order
assertEquals("superClassInterceptor", interceptorsList.get(0)); //derived from class extension
assertEquals("classInterceptor", interceptorsList.get(1)); //specified by @
@@ -74,71 +74,71 @@ public class StatefulInterceptorTests ex
assertEquals("superBeanInterceptor", interceptorsList.get(5)); //derived from bean extension
assertEquals("inBeanInterceptor", interceptorsList.get(6)); //in bean
}
-
+
/**
* Invokes just 1 business method on the bean. The interceptor method stores the intercepted method's name and
* params in a map that is returned by the <code>getContextData</code>
*/
public void test02_methodProfile() {
- String reverseMe = "Intercept";
- String reversedString = remoteInterceptor.reverse(reverseMe);
+ final String reverseMe = "Intercept";
+ final String reversedString = remoteInterceptor.reverse(reverseMe);
// verifying InvocationContext.procced()
assertEquals("tpecretnI", reversedString);
- Map contextData = remoteInterceptor.getContextData();
+ final Map contextData = remoteInterceptor.getContextData();
// verifying InvocationContext.getMethod().getName()
assertTrue(contextData.containsKey("reverse"));
- Map innerMap = (Map) contextData.get("reverse");
- Object[] params = (Object[]) innerMap.get("PARAMETERS");
+ final Map innerMap = (Map) contextData.get("reverse");
+ final Object[] params = (Object[]) innerMap.get("PARAMETERS");
// verifying that the parameters array was received from contextData and stored.
assertNotNull("value of PARAMETERS key is null", params);
// verifying InvocationContext.getParameters()
assertEquals(1, params.length);
assertEquals(reverseMe, params[0].toString());
}
-
+
/**
* Invokes a business method which is annotated to be excluded from interception.
* <code>getContextData()</code> has been annotated with <code>@ExcludesClassInterceptors</code>
*/
public void test03_excludeClassInterceptors() {
- Map contextData = remoteInterceptor.getContextData();
+ final Map contextData = remoteInterceptor.getContextData();
// verifying that inBeanInterceptor indeed intercepted this method. This cannot be excluded at all.
assertNotNull(contextData.containsKey("getContextData"));
-
- Map innerMap = (Map) contextData.get("getContextData");
- ArrayList interceptorsList = (ArrayList) innerMap.get("INTERCEPTORS");
+
+ final Map innerMap = (Map) contextData.get("getContextData");
+ final ArrayList interceptorsList = (ArrayList) innerMap.get("INTERCEPTORS");
// verifying @ExcludeClassInterceptors annotated method was not intercepted by class interceptors
assertFalse("getContextData() should not have been intercepted by superClassInterceptor()", interceptorsList.contains("superClassInterceptor"));
assertFalse("getContextData() should not have been intercepted by classInterceptor()", interceptorsList.contains("classInterceptor"));
assertFalse("getContextData() should not have been intercepted by secondClassInterceptor()", interceptorsList.contains("secondClassInterceptor"));
assertFalse("getContextData() should not have been intercepted by ddInterceptor()", interceptorsList.contains("ddInterceptor"));
}
-
+
/**
* Invokes a business method which is declared to be excluded from interception by the DD
* <code>getContextData()</code> has been annotated with <code>@ExcludesClassInterceptors</code>
*/
public void test04_excludeClassInterceptors_02() {
- String catString = remoteInterceptor.concat("Inter", "cept");
+ final String catString = remoteInterceptor.concat("Inter", "cept");
// verifying InvocationContext.procced()
assertEquals("Intercept", catString);
-
- Map contextData = remoteInterceptor.getContextData();
+
+ final Map contextData = remoteInterceptor.getContextData();
// verifying that inBeanInterceptor indeed intercepted this method. This cannot be excluded at all.
assertNotNull(contextData.containsKey("concat"));
-
- Map innerMap = (Map) contextData.get("concat");
- ArrayList interceptorsList = (ArrayList) innerMap.get("INTERCEPTORS");
+
+ final Map innerMap = (Map) contextData.get("concat");
+ final ArrayList interceptorsList = (ArrayList) innerMap.get("INTERCEPTORS");
// verifying @ExcludeClassInterceptors annotated method was not intercepted
assertFalse("concat() should not have been intercepted by superClassInterceptor()", interceptorsList.contains("superClassInterceptor"));
assertFalse("concat() should not have been intercepted by classInterceptor()", interceptorsList.contains("classInterceptor"));
assertFalse("concat() should not have been intercepted by ddInterceptor()", interceptorsList.contains("ddInterceptor"));
assertFalse("concat() should not have been intercepted by secondClassInterceptor()", interceptorsList.contains("secondClassInterceptor"));
}
-
+
/**
* Invokes a business method which is annotated to be excluded from interception.
* <code>getContextData()</code> has been annotated with <code>@ExcludesClassInterceptors</code>
@@ -146,13 +146,13 @@ public class StatefulInterceptorTests ex
public void test05_PreDestroy() {
try {
tearDown();
- Map contextData = remoteInterceptor.getContextData();
- Map innerMap = (Map) contextData.get("BasicStatefulInterceptedBean");
+ final Map contextData = remoteInterceptor.getContextData();
+ final Map innerMap = (Map) contextData.get("BasicStatefulInterceptedBean");
assertNotNull("InnerMap is null", innerMap);
- ArrayList interceptorsList = (ArrayList) innerMap.get("INTERCEPTORS");
+ final ArrayList interceptorsList = (ArrayList) innerMap.get("INTERCEPTORS");
// verifying interceptor chaining order
assertEquals("superClassInterceptorPreDestroy", interceptorsList.get(0));
- } catch (Exception e) {
+ } catch (final Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}