org.apache.ojb.broker
Class MtoNMapping

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

public class MtoNMapping
extends junit.framework.TestCase

This TestClass tests OJB facilities to work with polymorphism.


Field Summary
(package private)  PersistenceBroker broker
           
 
Constructor Summary
MtoNMapping(java.lang.String name)
           
 
Method Summary
static void main(java.lang.String[] args)
           
 void setUp()
           
 void tearDown()
           
 void testDeleteUnidirectional()
          delete all projects of a person
 void testDeletion()
          test deleting objects from an m:n association
 void testInsertAndDelete()
          Add a new Project, delete an existing Project
 void testInsertion()
          test inserting new objects to m:n association
 void testInsertWithIndirectionTable_1()
          Add two new persons and one new project.
 void testInsertWithIndirectionTable_2()
          Add two new persons and one new project.
 void testInsertWithIndirectionTable_3()
          Add two new persons to existing project.
 void testLoadingWithAssociationClass()
          test a manually build association via the association class Role
 void testMNLoading()
          test loading of m:n mapped object nets
 void testMNLoadingPrefetch()
          test loading of m:n mapped object nets with prefetch
 void testMNLoadingUnidirectional()
          test loading of m:n unidirectionally mapped objects
 void testPolymorphMToN()
          this tests if polymorph collections (i.e.
 void testPolymorphMToNDelete()
           
 void testPolymorphMToNUpdate()
           
 
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
 

Field Detail

broker

PersistenceBroker broker
Constructor Detail

MtoNMapping

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

main

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

setUp

public void setUp()

tearDown

public void tearDown()

testPolymorphMToN

public void testPolymorphMToN()
this tests if polymorph collections (i.e. collections of objects implementing a common interface) are treated correctly


testPolymorphMToNUpdate

public void testPolymorphMToNUpdate()

testPolymorphMToNDelete

public void testPolymorphMToNDelete()

testMNLoading

public void testMNLoading()
                   throws java.lang.Exception
test loading of m:n mapped object nets

Throws:
java.lang.Exception

testMNLoadingPrefetch

public void testMNLoadingPrefetch()
                           throws java.lang.Exception
test loading of m:n mapped object nets with prefetch

Throws:
java.lang.Exception

testMNLoadingUnidirectional

public void testMNLoadingUnidirectional()
                                 throws java.lang.Exception
test loading of m:n unidirectionally mapped objects

Throws:
java.lang.Exception

testLoadingWithAssociationClass

public void testLoadingWithAssociationClass()
                                     throws java.lang.Exception
test a manually build association via the association class Role

Throws:
java.lang.Exception

testInsertion

public void testInsertion()
                   throws java.lang.Exception
test inserting new objects to m:n association

Throws:
java.lang.Exception

testInsertAndDelete

public void testInsertAndDelete()
                         throws java.lang.Exception
Add a new Project, delete an existing Project

Throws:
java.lang.Exception

testInsertWithIndirectionTable_1

public void testInsertWithIndirectionTable_1()
                                      throws java.lang.Exception
Add two new persons and one new project. Assign persons with the new project and vice versa.

Throws:
java.lang.Exception

testInsertWithIndirectionTable_2

public void testInsertWithIndirectionTable_2()
                                      throws java.lang.Exception
Add two new persons and one new project. Assign persons with the new project and vice versa. both relationships are set to auto-update=true

Throws:
java.lang.Exception

testInsertWithIndirectionTable_3

public void testInsertWithIndirectionTable_3()
                                      throws java.lang.Exception
Add two new persons to existing project. Assign persons with the existing project and vice versa.

Throws:
java.lang.Exception

testDeletion

public void testDeletion()
                  throws java.lang.Exception
test deleting objects from an m:n association

Throws:
java.lang.Exception

testDeleteUnidirectional

public void testDeleteUnidirectional()
                              throws java.lang.Exception
delete all projects of a person

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