org.objectweb.jonas.jtests.clients.exception
Class A_CatcherEntity

java.lang.Object
  |
  +--junit.framework.Assert
        |
        +--junit.framework.TestCase
              |
              +--org.objectweb.jonas.jtests.util.JTestCase
                    |
                    +--org.objectweb.jonas.jtests.clients.exception.A_Catcher
                          |
                          +--org.objectweb.jonas.jtests.clients.exception.A_CatcherEntity
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
F_CatcherEB, F_CatcherEC, F_CatcherEC2

public abstract class A_CatcherEntity
extends A_Catcher


Fields inherited from class org.objectweb.jonas.jtests.util.JTestCase
ictx, isInit, jonasName, msgerror, testtorun, utx
 
Constructor Summary
A_CatcherEntity(java.lang.String name)
           
 
Method Summary
 AccountE getAccount(int i)
          return an Account
 AccountS getAccountS(int i)
          return an AccountS must be defined for common tests (A_Catcher.java)
abstract  AccountEHome getHome()
          return AccontHome, that can be either BMP or CMP bean.
 void testApplicationCallerTx2()
          Test business method throwing an Application exception.
 void testApplicationContTx2()
          Test business method throwing an Application exception.
 void testApplicationContTxRb2()
          Test business method throwing an Application exception.
 void testApplicationHomeContTx()
          Test create method throwing an Application exception.
 void testApplicationHomeNoTx()
          Test home method throwing an Application exception.
 void testApplicationHomeUserTx()
          Test Create method throwing an Application exception.
 void testApplicationRemovePkContTx()
          Test remove(pk) method throwing an Application exception (RemoveException).
 void testApplicationRemovePkUserTx()
          Test remove(pk) method throwing an Application exception (RemoveException).
 void testApplicationRemoveThisContTx()
          Test remove() method throwing an Application exception (RemoveException).
 void testApplicationRemoveThisUserTx()
          Test remove() method throwing an Application exception (RemoveException).
 void testRuntimeCallerTx()
          Test RuntimeException in a container-invoked callback (ejbStore) Methods runs in the context of the caller's transaction -> RollbackException should be received by the client on commit.
 void testRuntimeContTx()
          Test RuntimeException in a container-invoked callback (ejbStore) The bean has the TransationRequired attribute.
 void testUncheckedHomeContTx()
          Test ejbCreate method throwing an unchecked exception.
 void testUncheckedHomeUserTx()
          Test ejbCreate method throwing an unchecked exception.
 
Methods inherited from class org.objectweb.jonas.jtests.clients.exception.A_Catcher
setUp, testApplicationCallerTx1, testApplicationContTx1, testApplicationContTxRb1, testApplicationNotTx, testApplicationNoTx, testEJBContTx, testRemoteCallerTx, testUncheckedCallerTx, testUncheckedContTx, testUncheckedNoTx
 
Methods inherited from class org.objectweb.jonas.jtests.util.JTestCase
debug, getDBEnv, random, sleep, tearDown, testEmpty, unloadBeans, useBeans
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, name, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assert, assert, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertNotNull, assertNotNull, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

A_CatcherEntity

public A_CatcherEntity(java.lang.String name)
Method Detail

getAccount

public AccountE getAccount(int i)
return an Account

getAccountS

public AccountS getAccountS(int i)
return an AccountS must be defined for common tests (A_Catcher.java)
Overrides:
getAccountS in class A_Catcher

getHome

public abstract AccountEHome getHome()
return AccontHome, that can be either BMP or CMP bean.

testApplicationCallerTx2

public void testApplicationCallerTx2()
                              throws java.lang.Exception
Test business method throwing an Application exception. It must be caught by the client. Methods runs in the context of the caller's transaction The business method has Mandatory attribute. Test that the transaction has not been marked rollback. Spec 2.0 page 375 (table15)

testApplicationContTx2

public void testApplicationContTx2()
                            throws java.lang.Exception
Test business method throwing an Application exception. It must be caught by the client. A transaction is started in the container. (RequiresNew) Bean does NOT call setRollbackOnly Test that the transaction has not been marked rollback. Spec 2.0 page 376 (table15)

testApplicationContTxRb2

public void testApplicationContTxRb2()
                              throws java.lang.Exception
Test business method throwing an Application exception. It must be caught by the client. A transaction is started in the container. (RequiresNew) Bean calls setRollbackOnly Test that the transaction has been rolledback. Spec 2.0 page 376 (table15)

testApplicationHomeUserTx

public void testApplicationHomeUserTx()
                               throws java.lang.Exception
Test Create method throwing an Application exception. It must be caught by the client. Test that the transaction has not been marked rollback. equivalent to testApplicationContTx but the businessmethod is a create method Spec 2.0 page 376 (table15)

testApplicationHomeContTx

public void testApplicationHomeContTx()
                               throws java.lang.Exception
Test create method throwing an Application exception. It must be caught by the client. instance call setRollbackOnly The test verify the ac is not created equivalent to testApplicationContTxRb1 but for create method. Spec 2.0 page 376 (table15)

testApplicationHomeNoTx

public void testApplicationHomeNoTx()
                             throws java.lang.Exception
Test home method throwing an Application exception. It must be caught by the client. Spec 2.0 page 376 (table15)

testApplicationRemovePkContTx

public void testApplicationRemovePkContTx()
                                   throws java.lang.Exception
Test remove(pk) method throwing an Application exception (RemoveException). It must be caught by the client. A transaction is started in the container. (Required) Spec 2.0 page 376 (table15)

testApplicationRemovePkUserTx

public void testApplicationRemovePkUserTx()
                                   throws java.lang.Exception
Test remove(pk) method throwing an Application exception (RemoveException). It must be caught by the client. A transaction is started in the client. (Required) (This is a knowned bug: TransactionRolledbackException instead of RemoveException) Spec 2.0 page 376 (table15)

testApplicationRemoveThisContTx

public void testApplicationRemoveThisContTx()
                                     throws java.lang.Exception
Test remove() method throwing an Application exception (RemoveException). It must be caught by the client. A transaction is started in the container. (Required) equivalent to testApplicationRemoveHomeContTx but for obj.remove() method. Spec 2.0 page 376 (table15)

testApplicationRemoveThisUserTx

public void testApplicationRemoveThisUserTx()
                                     throws java.lang.Exception
Test remove() method throwing an Application exception (RemoveException). It must be caught by the client. A transaction is started in the client. (Required) equivalent to testApplicationRemoveHomeUserTx but for obj.remove() method. Spec 2.0 page 376 (table15)

testRuntimeContTx

public void testRuntimeContTx()
                       throws java.lang.Exception
Test RuntimeException in a container-invoked callback (ejbStore) The bean has the TransationRequired attribute. -> Exception must be logged, instance discarded, and the client should receive a RemoteException. See EJB2.0 specs §18.3.3 page 379

testRuntimeCallerTx

public void testRuntimeCallerTx()
                         throws java.lang.Exception
Test RuntimeException in a container-invoked callback (ejbStore) Methods runs in the context of the caller's transaction -> RollbackException should be received by the client on commit. See EJB2.0 specs §18.3.3 page 379

testUncheckedHomeContTx

public void testUncheckedHomeContTx()
                             throws java.lang.Exception
Test ejbCreate method throwing an unchecked exception. Called inside a containertransaction. The client must receive RemoteException See EJB2.0 specs page 376 (table 15)

testUncheckedHomeUserTx

public void testUncheckedHomeUserTx()
                             throws java.lang.Exception
Test ejbCreate method throwing an unchecked exception. Methods runs in the context of the caller's transaction A transaction has been started by the client. Called inside a client transaction. TransactionRolledbackException must be caught by the client. The business method has Mandatory attribute. See EJB2.0 specs page 375 (table 15)