org.apache.ojb.broker
Class CollectionTest

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

public class CollectionTest
extends junit.framework.TestCase

Test case for collection handling. Main class Gatherer have five collections of type CollectibleBase, CollectibleB, CollectibleC, CollectibleD, CollectibleDD Class hierarchy: [CollectibleBaseIF <--] CollectibleBase <-- CollectibleB <-- CollectibleC <-- CollectibleCC | | CollectibleD <-- CollectibleDD CollectibleCCC in repository interface CollectibleBaseIF was declared with five extents (CollectibleBase, CollectibleB, CollectibleC, CollectibleD, CollectibleDD) CollectibleBase auto-retrieve, auto-update, auto-delete all true proxy false CollectibleB auto-retrieve, auto-update set true, auto-delete false proxy true CollectibleC auto-retrieve, auto-update, auto-delete set true, proxy true CollectibleC has a reference back to the Gatherer object (auto-retrieve, auto-update, auto-delete set false to avoid circular object creation) CollectibleCC auto-retrieve true, auto-update true, auto-delete set true, proxy false CollectibleCCC auto-retrieve false, auto-update true, auto-delete set true, proxy false CollectibleD auto-retrieve, auto-update, auto-delete all true proxy false CollectibleDD auto-retrieve, auto-update, auto-delete all true proxy true TODO: Need some refactoring and more structured tests of different auto_xyz/proxy settings

Version:
$Id: CollectionTest.java,v 1.8 2004/02/18 12:49:32 arminw Exp $
Author:
Armin Waibel

Nested Class Summary
static class CollectionTest.Book
           
static class CollectionTest.BookShelf
           
static class CollectionTest.BookShelfItem
           
static class CollectionTest.CollectibleB
           
static class CollectionTest.CollectibleBase
           
static interface CollectionTest.CollectibleBaseIF
           
static interface CollectionTest.CollectibleBIF
           
static class CollectionTest.CollectibleC
           
static class CollectionTest.CollectibleCC
           
static class CollectionTest.CollectibleCCC
           
static interface CollectionTest.CollectibleCIF
           
static class CollectionTest.CollectibleD
           
static class CollectionTest.CollectibleDD
           
static interface CollectionTest.CollectibleDDIF
           
static interface CollectionTest.CollectibleDIF
           
static class CollectionTest.CollectionClassDummy
           
static class CollectionTest.DVD
           
static class CollectionTest.Gatherer
           
 
Constructor Summary
CollectionTest()
           
 
Method Summary
static void main(java.lang.String[] args)
           
 void setUp()
           
 void tearDown()
           
 void testAddNewObjectsToExistingCollection()
          Add new reference objects to an existing collection reference (1:n) of a main object.
 void testDeleteCollection()
          generate main object with collections and store main object to make all persistent
 void testDeleteMainObjectWithOneToNRelation()
          generate main object with collections and store main object to make all persistent
 void testOneBookShelfQueryByCollection()
           
 void testOneBookShelfQueryByIterator()
           
 void testReadProxyCollection()
           
 void testStoreCollectionObjectsWithBackReference()
          generate main object with collections and store main object to make all persistent.
 void testStoreDeleteSimpleCollections_2()
          generate main object with collections and store main object to make all persistent using ojbConcreteClass feature to map different objects to same table
 void testStoreDeleteSimpleCollections()
          generate main object with collections and store main object to make all persistent
 void testStoreReadOfUserDefinedCollectionClass_2()
           
 void testStoreReadOfUserDefinedCollectionClass()
           
 void testStoreSimpleCollections()
           
 
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

CollectionTest

public CollectionTest()
Method Detail

main

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

setUp

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

tearDown

public void tearDown()

testReadProxyCollection

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

testStoreReadOfUserDefinedCollectionClass

public void testStoreReadOfUserDefinedCollectionClass()

testStoreReadOfUserDefinedCollectionClass_2

public void testStoreReadOfUserDefinedCollectionClass_2()

testStoreDeleteSimpleCollections

public void testStoreDeleteSimpleCollections()
generate main object with collections and store main object to make all persistent


testDeleteCollection

public void testDeleteCollection()
generate main object with collections and store main object to make all persistent


testDeleteMainObjectWithOneToNRelation

public void testDeleteMainObjectWithOneToNRelation()
generate main object with collections and store main object to make all persistent


testStoreDeleteSimpleCollections_2

public void testStoreDeleteSimpleCollections_2()
generate main object with collections and store main object to make all persistent using ojbConcreteClass feature to map different objects to same table


testStoreSimpleCollections

public void testStoreSimpleCollections()

testAddNewObjectsToExistingCollection

public void testAddNewObjectsToExistingCollection()
Add new reference objects to an existing collection reference (1:n) of a main object.


testStoreCollectionObjectsWithBackReference

public void testStoreCollectionObjectsWithBackReference()
generate main object with collections and store main object to make all persistent. same like testStoreSimpleCollections() but now the collection objects have a reference back to main object. Curious but this test does not pass


testOneBookShelfQueryByCollection

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

testOneBookShelfQueryByIterator

public void testOneBookShelfQueryByIterator()
                                     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