org.objectweb.jonas.jtests.clients.entity
Class A_AdvancedHomeEC

java.lang.Object
  |
  +--junit.framework.Assert
        |
        +--junit.framework.TestCase
              |
              +--org.objectweb.jonas.jtests.util.JTestCase
                    |
                    +--org.objectweb.jonas.jtests.clients.entity.A_AdvancedHomeEC
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
F_AdvancedHomeEC, F_AdvancedHomeEC2

public abstract class A_AdvancedHomeEC
extends JTestCase

This is an advanced test suite for home interface on entity bean CMP. Beans used: annuaire

Author:
Philippe Coq, Philippe Durieux, Helene Joanin (jonas team)

Fields inherited from class org.objectweb.jonas.jtests.util.JTestCase
ictx, isInit, jonasName, msgerror, testtorun, utx
 
Constructor Summary
A_AdvancedHomeEC(java.lang.String name)
           
 
Method Summary
abstract  PersonneHome getHome()
          return PersonneHome, that can be either CMP v1 or CMP v2 bean.
protected  void setUp()
          common setUp routine, used for every test.
 void testCreateAndBusiness()
          Test Create + Business Method inside the same Tx
 void testCreateInTx()
          test Create inside a Transaction.
 void testCreateNull()
          Verify that we can create an entity with a null name
 void testCreateRemoveInTx()
          Test create + remove in transactions
 void testDuplicateKey()
          Test DuplicateKeyException.
 void testDuplicateKeyTx()
          Test DuplicateKeyException.
 void testFindAllEnum()
          test du findAll, returning an Enumeration.
 void testFinderInTx()
          Test finder in transactions
 void testFindTwice()
          test 2 findByPrimaryKey in the same tx, with an update between the 2 calls.
 void testIsolation()
          Combination of other tests This test the transaction isolation in entity bean container this test must never hang
 void testManyCreate()
          Test many Create calls
 void testRemove()
          Test bean.remove : create / find / remove / find
 void testRemoveInTx()
          Test bean.remove inside a tx: create / find / remove / find
 void testRemovePk()
          Test remove(pk): create / find / remove(pk) / find
 void testRemovePkInTx()
          Test remove(pk) inside transaction: create / find / remove(pk) / find
 void testRemovePkNonExistent()
          Test remove(pk) of a non-existent pk.
 void testRemovePkNonExistentInTx()
          Test remove(pk) of a non-existent pk inside transaction.
 void testRemovePKRB()
          Test remove by PK in a tx rolled back we modify the bean instance outside tx, then we check that the bean state has not been changed by the rolled back remove
 void testRemoveRB()
          Test remove in a tx rolled back we modify the bean instance outside tx, then we check that the bean state has not been changed by the rolled back remove
 void testSimpleCreateInTx()
          test a simple Create inside a Transaction.
 void testSimpleRemove()
          test a simple Remove Find an instance already in database and remove it.
 
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_AdvancedHomeEC

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

setUp

protected void setUp()
Description copied from class: JTestCase
common setUp routine, used for every test.
Overrides:
setUp in class JTestCase

getHome

public abstract PersonneHome getHome()
return PersonneHome, that can be either CMP v1 or CMP v2 bean.

testFindAllEnum

public void testFindAllEnum()
                     throws java.lang.Exception
test du findAll, returning an Enumeration. Some of the beans are already in the database, some other are created.

testCreateInTx

public void testCreateInTx()
                    throws java.lang.Exception
test Create inside a Transaction.

testSimpleCreateInTx

public void testSimpleCreateInTx()
                          throws java.lang.Exception
test a simple Create inside a Transaction.

testSimpleRemove

public void testSimpleRemove()
                      throws java.lang.Exception
test a simple Remove Find an instance already in database and remove it.

testCreateAndBusiness

public void testCreateAndBusiness()
                           throws java.lang.Exception
Test Create + Business Method inside the same Tx

testRemovePk

public void testRemovePk()
                  throws java.lang.Exception
Test remove(pk): create / find / remove(pk) / find

testRemovePkInTx

public void testRemovePkInTx()
                      throws java.lang.Exception
Test remove(pk) inside transaction: create / find / remove(pk) / find

testRemovePkNonExistent

public void testRemovePkNonExistent()
                             throws java.lang.Exception
Test remove(pk) of a non-existent pk.

testRemovePkNonExistentInTx

public void testRemovePkNonExistentInTx()
                                 throws java.lang.Exception
Test remove(pk) of a non-existent pk inside transaction. (This is a knowned bug: TransactionRolledbackException instead of RemoveException)

testRemove

public void testRemove()
                throws java.lang.Exception
Test bean.remove : create / find / remove / find

testRemovePKRB

public void testRemovePKRB()
                    throws java.lang.Exception
Test remove by PK in a tx rolled back we modify the bean instance outside tx, then we check that the bean state has not been changed by the rolled back remove

testRemoveRB

public void testRemoveRB()
                  throws java.lang.Exception
Test remove in a tx rolled back we modify the bean instance outside tx, then we check that the bean state has not been changed by the rolled back remove

testRemoveInTx

public void testRemoveInTx()
                    throws java.lang.Exception
Test bean.remove inside a tx: create / find / remove / find

testFinderInTx

public void testFinderInTx()
                    throws java.lang.Exception
Test finder in transactions

testCreateRemoveInTx

public void testCreateRemoveInTx()
                          throws java.lang.Exception
Test create + remove in transactions

testFindTwice

public void testFindTwice()
                   throws java.lang.Exception
test 2 findByPrimaryKey in the same tx, with an update between the 2 calls. We shall see the modifications, even before the commit occurs.

testDuplicateKeyTx

public void testDuplicateKeyTx()
                        throws java.lang.Exception
Test DuplicateKeyException. Create in an implicit tx

testDuplicateKey

public void testDuplicateKey()
                      throws java.lang.Exception
Test DuplicateKeyException. Create outside tx

testCreateNull

public void testCreateNull()
                    throws java.lang.Exception
Verify that we can create an entity with a null name

testManyCreate

public void testManyCreate()
                    throws java.lang.Exception
Test many Create calls

testIsolation

public void testIsolation()
                   throws java.lang.Exception
Combination of other tests This test the transaction isolation in entity bean container this test must never hang