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

java.lang.Object
  |
  +--junit.framework.Assert
        |
        +--junit.framework.TestCase
              |
              +--org.objectweb.jonas.jtests.util.JTestCase
                    |
                    +--org.objectweb.jonas.jtests.clients.entity.A_Relation
                          |
                          +--org.objectweb.jonas.jtests.clients.entity.F_Relation_ombEC2
All Implemented Interfaces:
junit.framework.Test

public class F_Relation_ombEC2
extends A_Relation

For testing one-to-many bidirectional relationships

Author:
Helene Joanin

Field Summary
protected static AHomeRemote ahome
           
protected static BHomeRemote bhome
           
 
Fields inherited from class org.objectweb.jonas.jtests.util.JTestCase
ictx, isInit, jonasName, msgerror, testtorun, utx
 
Constructor Summary
F_Relation_ombEC2(java.lang.String name)
           
 
Method Summary
 void _testBasicGetEmptyA2B(int tx)
          Check that the bean 'as0' has no relation.
 void _testBasicGetEmptyB2A(int tx)
          Check that the bean 'bs0' has no relation.
 void _testBasicGetManyA2B(int tx)
          Check that the bean 'as2' has many relations with 'bs2_1', 'bs2_2', 'bs2_3'.
 void _testBasicGetOneA2B(int tx)
          Check that the bean 'as1' has only one relation with 'bs1_1'.
 void _testCohAddOneA2B(int tx)
          Add an element to a empty relation.
 void _testCohAddOneInMultiA2B(int tx)
          Add an element to a relation A2B already multiple.
 void _testCohBeanRemoveB(int tx)
          Remove a bean B which is in a relation.
 void _testCohClearA2B(int tx)
          Set a A2B relation to empty by clearing the collection.
 void _testCohRemoveB(int tx)
          Remove a bean B which is in a relation.
 void _testCohRemoveInRelA2B(int tx)
          Remove an element in a relation.
 void _testCohSet1B2A(int tx)
          Set a null B2A relation with 1 element.
 void _testCohSet2B2A(int tx)
          Set a B2A relation with 1 element.
 void _testCohSet3B2A(int tx)
          Set a B2A relation with 1 element.
 void _testCohSetEmptyA2B(int tx)
          Set a A2B relation to empty.
 void _testCohSetMultiA2B(int tx)
          Re-Set a relation with N element.
 void _testCohSetMultiBisA2B(int tx)
           
 void _testCohSetOne2A2B(int tx)
          Set a empty relation A2B with 1 element.
 void _testCohSetOneA2B(int tx)
          Set an empty A2B relation with 1 element.
static void main(java.lang.String[] args)
           
protected  void setUp()
          common setUp routine, used for every test.
static junit.framework.Test suite()
           
 void testBasicGetEmptyA2BTxCall()
           
 void testBasicGetEmptyA2BTxCont()
           
 void testBasicGetEmptyA2BTxNo()
           
 void testBasicGetEmptyA2BTxRb()
           
 void testBasicGetEmptyB2ANoTx()
           
 void testBasicGetEmptyB2ATxCall()
           
 void testBasicGetEmptyB2ATxCont()
           
 void testBasicGetEmptyB2ATxRb()
           
 void testBasicGetManyA2BTxCall()
           
 void testBasicGetManyA2BTxCont()
           
 void testBasicGetManyA2BTxNo()
           
 void testBasicGetManyA2BTxRb()
           
 void testBasicGetOneA2BTxCall()
           
 void testBasicGetOneA2BTxCont()
           
 void testBasicGetOneA2BTxNo()
           
 void testBasicGetOneA2BTxRb()
           
 void testCohAddOneA2BTxCall()
           
 void testCohAddOneA2BTxCont()
           
 void testCohAddOneA2BTxNo()
           
 void testCohAddOneA2BTxRb()
           
 void testCohAddOneInMultiA2BTxCall()
           
 void testCohAddOneInMultiA2BTxCont()
           
 void testCohAddOneInMultiA2BTxNo()
           
 void testCohAddOneInMultiA2BTxRb()
           
 void testCohBeanRemoveBTxCall()
           
 void testCohBeanRemoveBTxNo()
           
 void testCohBeanRemoveBTxRb()
           
 void testCohClearA2BTxCall()
           
 void testCohClearA2BTxCont()
           
 void testCohClearA2BTxNo()
           
 void testCohClearA2BTxRb()
           
 void testCohRemoveBTxCall()
           
 void testCohRemoveBTxNo()
           
 void testCohRemoveBTxRb()
           
 void testCohRemoveInRelA2BTxCall()
           
 void testCohRemoveInRelA2BTxCont()
           
 void testCohRemoveInRelA2BTxNo()
           
 void testCohRemoveInRelA2BTxRb()
           
 void testCohSet1B2ATxCall()
           
 void testCohSet1B2ATxCont()
           
 void testCohSet1B2ATxNo()
           
 void testCohSet1B2ATxRb()
           
 void testCohSet2B2ATxCall()
           
 void testCohSet2B2ATxCont()
           
 void testCohSet2B2ATxNo()
           
 void testCohSet2B2ATxRb()
           
 void testCohSet3B2ATxCall()
           
 void testCohSet3B2ATxCont()
           
 void testCohSet3B2ATxNo()
           
 void testCohSet3B2ATxRb()
           
 void testCohSetEmptyA2BTxCall()
           
 void testCohSetEmptyA2BTxCont()
           
 void testCohSetEmptyA2BTxNo()
           
 void testCohSetEmptyA2BTxRb()
           
 void testCohSetMultiA2BTxCall()
           
 void testCohSetMultiA2BTxCont()
           
 void testCohSetMultiA2BTxNo()
           
 void testCohSetMultiA2BTxRb()
           
 void testCohSetMultiBisA2BTxCall()
           
 void testCohSetMultiBisA2BTxCont()
           
 void testCohSetMultiBisA2BTxNo()
           
 void testCohSetMultiBisA2BTxRb()
           
 void testCohSetOne2A2BTxCall()
           
 void testCohSetOne2A2BTxCont()
           
 void testCohSetOne2A2BTxNo()
           
 void testCohSetOne2A2BTxRb()
           
 void testCohSetOneA2BTxCall()
           
 void testCohSetOneA2BTxCont()
           
 void testCohSetOneA2BTxNo()
           
 void testCohSetOneA2BTxRb()
           
 void testResetPkForbidden()
          This test check it isn't allowed to reset the pk and that the container throw the java.lang.IllegalStateException.
 
Methods inherited from class org.objectweb.jonas.jtests.clients.entity.A_Relation
getIntAfterDash, getStringBeforeDash
 
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
 

Field Detail

ahome

protected static AHomeRemote ahome

bhome

protected static BHomeRemote bhome
Constructor Detail

F_Relation_ombEC2

public F_Relation_ombEC2(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

_testBasicGetEmptyA2B

public void _testBasicGetEmptyA2B(int tx)
                           throws java.lang.Exception
Check that the bean 'as0' has no relation.

testBasicGetEmptyA2BTxNo

public void testBasicGetEmptyA2BTxNo()
                              throws java.lang.Exception

testBasicGetEmptyA2BTxCall

public void testBasicGetEmptyA2BTxCall()
                                throws java.lang.Exception

testBasicGetEmptyA2BTxCont

public void testBasicGetEmptyA2BTxCont()
                                throws java.lang.Exception

testBasicGetEmptyA2BTxRb

public void testBasicGetEmptyA2BTxRb()
                              throws java.lang.Exception

_testBasicGetEmptyB2A

public void _testBasicGetEmptyB2A(int tx)
                           throws java.lang.Exception
Check that the bean 'bs0' has no relation.

testBasicGetEmptyB2ANoTx

public void testBasicGetEmptyB2ANoTx()
                              throws java.lang.Exception

testBasicGetEmptyB2ATxCall

public void testBasicGetEmptyB2ATxCall()
                                throws java.lang.Exception

testBasicGetEmptyB2ATxCont

public void testBasicGetEmptyB2ATxCont()
                                throws java.lang.Exception

testBasicGetEmptyB2ATxRb

public void testBasicGetEmptyB2ATxRb()
                              throws java.lang.Exception

_testBasicGetOneA2B

public void _testBasicGetOneA2B(int tx)
                         throws java.lang.Exception
Check that the bean 'as1' has only one relation with 'bs1_1'.

testBasicGetOneA2BTxNo

public void testBasicGetOneA2BTxNo()
                            throws java.lang.Exception

testBasicGetOneA2BTxCall

public void testBasicGetOneA2BTxCall()
                              throws java.lang.Exception

testBasicGetOneA2BTxCont

public void testBasicGetOneA2BTxCont()
                              throws java.lang.Exception

testBasicGetOneA2BTxRb

public void testBasicGetOneA2BTxRb()
                            throws java.lang.Exception

_testBasicGetManyA2B

public void _testBasicGetManyA2B(int tx)
                          throws java.lang.Exception
Check that the bean 'as2' has many relations with 'bs2_1', 'bs2_2', 'bs2_3'.

testBasicGetManyA2BTxNo

public void testBasicGetManyA2BTxNo()
                             throws java.lang.Exception

testBasicGetManyA2BTxCall

public void testBasicGetManyA2BTxCall()
                               throws java.lang.Exception

testBasicGetManyA2BTxCont

public void testBasicGetManyA2BTxCont()
                               throws java.lang.Exception

testBasicGetManyA2BTxRb

public void testBasicGetManyA2BTxRb()
                             throws java.lang.Exception

_testCohSetEmptyA2B

public void _testCohSetEmptyA2B(int tx)
                         throws java.lang.Exception
Set a A2B relation to empty. Before: as1 <-> bs1_1 After: as1 bs1_1 Check also the assignement rules for relationships.

testCohSetEmptyA2BTxNo

public void testCohSetEmptyA2BTxNo()
                            throws java.lang.Exception

testCohSetEmptyA2BTxCall

public void testCohSetEmptyA2BTxCall()
                              throws java.lang.Exception

testCohSetEmptyA2BTxCont

public void testCohSetEmptyA2BTxCont()
                              throws java.lang.Exception

testCohSetEmptyA2BTxRb

public void testCohSetEmptyA2BTxRb()
                            throws java.lang.Exception

_testCohClearA2B

public void _testCohClearA2B(int tx)
                      throws java.lang.Exception
Set a A2B relation to empty by clearing the collection. Before: as1 <-> bs1_1 After: as1 bs1_1 Check also the assignement rules for relationships.

testCohClearA2BTxNo

public void testCohClearA2BTxNo()
                         throws java.lang.Exception

testCohClearA2BTxCall

public void testCohClearA2BTxCall()
                           throws java.lang.Exception

testCohClearA2BTxCont

public void testCohClearA2BTxCont()
                           throws java.lang.Exception

testCohClearA2BTxRb

public void testCohClearA2BTxRb()
                         throws java.lang.Exception

_testCohSetOneA2B

public void _testCohSetOneA2B(int tx)
                       throws java.lang.Exception
Set an empty A2B relation with 1 element. This added element was'nt already in an other relation. Before: as0 b0 After: as0 <-> b0 Check also the assignement rules for relationships.

testCohSetOneA2BTxNo

public void testCohSetOneA2BTxNo()
                          throws java.lang.Exception

testCohSetOneA2BTxCall

public void testCohSetOneA2BTxCall()
                            throws java.lang.Exception

testCohSetOneA2BTxCont

public void testCohSetOneA2BTxCont()
                            throws java.lang.Exception

testCohSetOneA2BTxRb

public void testCohSetOneA2BTxRb()
                          throws java.lang.Exception

_testCohSet1B2A

public void _testCohSet1B2A(int tx)
                     throws java.lang.Exception
Set a null B2A relation with 1 element. This element was'nt already in an other relation. Before: b0 as0 After: b0 <-> as0 Check also the assignement rules for relationships.

testCohSet1B2ATxNo

public void testCohSet1B2ATxNo()
                        throws java.lang.Exception

testCohSet1B2ATxCall

public void testCohSet1B2ATxCall()
                          throws java.lang.Exception

testCohSet1B2ATxCont

public void testCohSet1B2ATxCont()
                          throws java.lang.Exception

testCohSet1B2ATxRb

public void testCohSet1B2ATxRb()
                        throws java.lang.Exception

_testCohAddOneA2B

public void _testCohAddOneA2B(int tx)
                       throws java.lang.Exception
Add an element to a empty relation. Same as _testCohSetOneA2B except that we add the element in the collection instead of we set directly the collection. Before: as0 bs0 After: as0 <-> bs0 Check also the assignement rules for relationships.

testCohAddOneA2BTxNo

public void testCohAddOneA2BTxNo()
                          throws java.lang.Exception

testCohAddOneA2BTxCall

public void testCohAddOneA2BTxCall()
                            throws java.lang.Exception

testCohAddOneA2BTxCont

public void testCohAddOneA2BTxCont()
                            throws java.lang.Exception

testCohAddOneA2BTxRb

public void testCohAddOneA2BTxRb()
                          throws java.lang.Exception

_testCohSetMultiA2B

public void _testCohSetMultiA2B(int tx)
                         throws java.lang.Exception
Re-Set a relation with N element. Before: as1 <-> bs1_1 bs0 bs3 After: bs1_1 as1 <-> bs0 as1 <-> bs3

testCohSetMultiA2BTxNo

public void testCohSetMultiA2BTxNo()
                            throws java.lang.Exception

testCohSetMultiA2BTxCall

public void testCohSetMultiA2BTxCall()
                              throws java.lang.Exception

testCohSetMultiA2BTxCont

public void testCohSetMultiA2BTxCont()
                              throws java.lang.Exception

testCohSetMultiA2BTxRb

public void testCohSetMultiA2BTxRb()
                            throws java.lang.Exception

_testCohSet2B2A

public void _testCohSet2B2A(int tx)
                     throws java.lang.Exception
Set a B2A relation with 1 element. This element wasn't already in an other relation. Before: bs1_1 <-> as1 as0 Change: bs1_1.assignA(as0); After: bs1_1 <-> as0 as1 Check also the assignement rules for relationships.

testCohSet2B2ATxNo

public void testCohSet2B2ATxNo()
                        throws java.lang.Exception

testCohSet2B2ATxCall

public void testCohSet2B2ATxCall()
                          throws java.lang.Exception

testCohSet2B2ATxCont

public void testCohSet2B2ATxCont()
                          throws java.lang.Exception

testCohSet2B2ATxRb

public void testCohSet2B2ATxRb()
                        throws java.lang.Exception

_testCohSet3B2A

public void _testCohSet3B2A(int tx)
                     throws java.lang.Exception
Set a B2A relation with 1 element. This element was already in an other relation. Before: bs1_1 <-> as1 b3_1 <-> a3 Change: bs1_1.assignA(b3_1.retrieveA()) After: bs1_1 <-> a3 b3_1 <-> as1 Check also the assignement rules for relationships. See Spec chapter 10.3.7.3, change example: b2m.setA(b1n.getA())

testCohSet3B2ATxNo

public void testCohSet3B2ATxNo()
                        throws java.lang.Exception

testCohSet3B2ATxCall

public void testCohSet3B2ATxCall()
                          throws java.lang.Exception

testCohSet3B2ATxCont

public void testCohSet3B2ATxCont()
                          throws java.lang.Exception

testCohSet3B2ATxRb

public void testCohSet3B2ATxRb()
                        throws java.lang.Exception

_testCohRemoveInRelA2B

public void _testCohRemoveInRelA2B(int tx)
                            throws java.lang.Exception
Remove an element in a relation. Before: a3 <-> b3_1 Change: a3.retrieveB().remove(b3_1) After: a3 b3_1 See Spec chapter 10.3.7.3, change example: a1.getB().remove(b1n)

testCohRemoveInRelA2BTxNo

public void testCohRemoveInRelA2BTxNo()
                               throws java.lang.Exception

testCohRemoveInRelA2BTxCall

public void testCohRemoveInRelA2BTxCall()
                                 throws java.lang.Exception

testCohRemoveInRelA2BTxCont

public void testCohRemoveInRelA2BTxCont()
                                 throws java.lang.Exception

testCohRemoveInRelA2BTxRb

public void testCohRemoveInRelA2BTxRb()
                               throws java.lang.Exception

_testCohRemoveB

public void _testCohRemoveB(int tx)
                     throws java.lang.Exception
Remove a bean B which is in a relation. Before: a3 <-> b3_1 change: B.remove(b3_1) After: a3

testCohRemoveBTxNo

public void testCohRemoveBTxNo()
                        throws java.lang.Exception

testCohRemoveBTxCall

public void testCohRemoveBTxCall()
                          throws java.lang.Exception

testCohRemoveBTxRb

public void testCohRemoveBTxRb()
                        throws java.lang.Exception

_testCohBeanRemoveB

public void _testCohBeanRemoveB(int tx)
                         throws java.lang.Exception
Remove a bean B which is in a relation. Same as _testCohRemoveB except that the called remove method is on the bean instead of the home. Before: a3 <-> b3_1 change: B.remove(b3_1) After: a3

testCohBeanRemoveBTxNo

public void testCohBeanRemoveBTxNo()
                            throws java.lang.Exception

testCohBeanRemoveBTxCall

public void testCohBeanRemoveBTxCall()
                              throws java.lang.Exception

testCohBeanRemoveBTxRb

public void testCohBeanRemoveBTxRb()
                            throws java.lang.Exception

_testCohSetOne2A2B

public void _testCohSetOne2A2B(int tx)
                        throws java.lang.Exception
Set a empty relation A2B with 1 element. This added element was already in a other relation. Before: a0 a3 <-> b3_1 Change: a0.assignB({b3_1}) After: a0 <-> b3_1 a3

testCohSetOne2A2BTxNo

public void testCohSetOne2A2BTxNo()
                           throws java.lang.Exception

testCohSetOne2A2BTxCall

public void testCohSetOne2A2BTxCall()
                             throws java.lang.Exception

testCohSetOne2A2BTxCont

public void testCohSetOne2A2BTxCont()
                             throws java.lang.Exception

testCohSetOne2A2BTxRb

public void testCohSetOne2A2BTxRb()
                           throws java.lang.Exception

_testCohAddOneInMultiA2B

public void _testCohAddOneInMultiA2B(int tx)
                              throws java.lang.Exception
Add an element to a relation A2B already multiple. The element was already in a relation. Check also the assignement rules for relationships. Before: a1 <-> b1_1 <-> b1_2 <-> b1_3 a3 <-> b3_1 Change: a1.addInB(b3_1) After: a1 <-> b1_1 <-> b1_2 <-> b1_3 <-> b3_1 a3 See Spec chapter 10.3.7.3, change example: a1.getB().add(b2m)

testCohAddOneInMultiA2BTxNo

public void testCohAddOneInMultiA2BTxNo()
                                 throws java.lang.Exception

testCohAddOneInMultiA2BTxCall

public void testCohAddOneInMultiA2BTxCall()
                                   throws java.lang.Exception

testCohAddOneInMultiA2BTxCont

public void testCohAddOneInMultiA2BTxCont()
                                   throws java.lang.Exception

testCohAddOneInMultiA2BTxRb

public void testCohAddOneInMultiA2BTxRb()
                                 throws java.lang.Exception

_testCohSetMultiBisA2B

public void _testCohSetMultiBisA2B(int tx)
                            throws java.lang.Exception

testCohSetMultiBisA2BTxNo

public void testCohSetMultiBisA2BTxNo()
                               throws java.lang.Exception

testCohSetMultiBisA2BTxCall

public void testCohSetMultiBisA2BTxCall()
                                 throws java.lang.Exception

testCohSetMultiBisA2BTxCont

public void testCohSetMultiBisA2BTxCont()
                                 throws java.lang.Exception

testCohSetMultiBisA2BTxRb

public void testCohSetMultiBisA2BTxRb()
                               throws java.lang.Exception

testResetPkForbidden

public void testResetPkForbidden()
                          throws java.lang.Exception
This test check it isn't allowed to reset the pk and that the container throw the java.lang.IllegalStateException. See spec 2.0, chapter 10.3.5, page 134.

suite

public static junit.framework.Test suite()

main

public static void main(java.lang.String[] args)