org.apache.ojb.odmg
Class CollectionsTest

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byorg.apache.ojb.odmg.CollectionsTest
All Implemented Interfaces:
junit.framework.Test

public class CollectionsTest
extends junit.framework.TestCase

Test case handles with collections.

Version:
$Id: CollectionsTest.java,v 1.10 2004/02/18 16:43:57 arminw Exp $
Author:
Armin Waibel

Nested Class Summary
static class CollectionsTest.CollectibleA
           
static interface CollectionsTest.CollectibleAIF
           
static class CollectionsTest.CollectibleB
           
static interface CollectionsTest.CollectibleBIF
           
static class CollectionsTest.CollectibleC
           
static interface CollectionsTest.CollectibleCIF
           
static class CollectionsTest.Gatherer
           
 
Constructor Summary
CollectionsTest(java.lang.String s)
           
 
Method Summary
static void main(java.lang.String[] args)
           
 void setUp()
           
protected  void tearDown()
           
 void testAddCollectionElementCrossAPI()
           
 void testAddCollectionElementWithBackReference()
          Create an main object Gatherer with a collection of objects CollectiblesC (CollectiblesC has a reference back to the main object).
 void testAddCollectionElementWithoutBackReference()
          Create an main object Gatherer with a collection of objects CollectiblesC.
 void testRemoveCollectionElementWithoutBackReference_2()
          Create an main object Gatherer with a collection of objects CollectiblesC.
 void testRemoveCollectionElementWithoutBackReference()
          Create an main object Gatherer with a collection of objects CollectiblesC.
 void testStoreDeleteCollectionElementWithBackReference()
           
 void testStoreFetchDeleteCollectionWithBackReference()
           
 void testUpdateCollection()
          Create object with 3 objects in associated collection.
 void testUpdateCollectionWithBackReference()
           
 void testUpdateWhenExchangeObjectsInCollection()
          we create two objects with one object in collection: gat1{collC1} and gat2{collC2} then we exchange the collections gat1{collC2} and gat2{collC1} and commit.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, 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

CollectionsTest

public CollectionsTest(java.lang.String s)
Method Detail

main

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

setUp

public void setUp()
           throws java.lang.Exception
Throws:
java.lang.Exception

tearDown

protected void tearDown()
                 throws java.lang.Exception
Throws:
java.lang.Exception

testRemoveCollectionElementWithoutBackReference

public void testRemoveCollectionElementWithoutBackReference()
                                                     throws java.lang.Exception
Create an main object Gatherer with a collection of objects CollectiblesC. CollectiblesC hasn't a reference back to the main object. After creation we remove an collection element.

Throws:
java.lang.Exception

testStoreFetchDeleteCollectionWithBackReference

public void testStoreFetchDeleteCollectionWithBackReference()
                                                     throws java.lang.Exception
Throws:
java.lang.Exception

testStoreDeleteCollectionElementWithBackReference

public void testStoreDeleteCollectionElementWithBackReference()
                                                       throws java.lang.Exception
Throws:
java.lang.Exception

testUpdateCollectionWithBackReference

public void testUpdateCollectionWithBackReference()
                                           throws java.lang.Exception
Throws:
java.lang.Exception

testUpdateCollection

public void testUpdateCollection()
                          throws java.lang.Exception
Create object with 3 objects in associated collection. We change one object of the collection

Throws:
java.lang.Exception

testUpdateWhenExchangeObjectsInCollection

public void testUpdateWhenExchangeObjectsInCollection()
                                               throws java.lang.Exception
we create two objects with one object in collection: gat1{collC1} and gat2{collC2} then we exchange the collections gat1{collC2} and gat2{collC1} and commit. So the size of the collection hold by the main object doesn't change todo: see ...odmg.ObjectEnvelope line 311

Throws:
java.lang.Exception

testRemoveCollectionElementWithoutBackReference_2

public void testRemoveCollectionElementWithoutBackReference_2()
                                                       throws java.lang.Exception
Create an main object Gatherer with a collection of objects CollectiblesC. CollectiblesC hasn't a reference back to the main object, thus we don't have to set the main object in the collection objects. Further we can't set the object id of the main object, because we don't know it at creation time. Then we remove one object of the collection

Throws:
java.lang.Exception

testAddCollectionElementWithoutBackReference

public void testAddCollectionElementWithoutBackReference()
                                                  throws java.lang.Exception
Create an main object Gatherer with a collection of objects CollectiblesC. CollectiblesC hasn't a reference back to the main object, thus we don't have to set the main object in the collection objects. Further we can't set the object id of the main object, because we don't know it at creation time. Then we ADD a new object to the collection

Throws:
java.lang.Exception

testAddCollectionElementWithBackReference

public void testAddCollectionElementWithBackReference()
                                               throws java.lang.Exception
Create an main object Gatherer with a collection of objects CollectiblesC (CollectiblesC has a reference back to the main object). Then we ADD a new object to the collection

Throws:
java.lang.Exception

testAddCollectionElementCrossAPI

public void testAddCollectionElementCrossAPI()
                                      throws java.lang.Exception
Throws:
java.lang.Exception


Authors: Thomas Mahler and others. (C) 2000 - 2003 Apache Software Foundation
All rights reserved. Published under the Apache License.
http://db.apache.org/ojb
Version: 1.0.rc5, 2003-12-14