org.apache.ojb.broker
Class BrokerExamples

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

public class BrokerExamples
extends junit.framework.TestCase

Demo Application that shows basic concepts for Applications using the PersistenceBroker as a mediator for persistence


Field Summary
(package private)  PersistenceBroker broker
           
 
Constructor Summary
BrokerExamples(java.lang.String name)
          Insert the method's description here.
 
Method Summary
protected  Article createArticle(int id)
          Insert the method's description here.
protected  Article createSimpleArticle(int id)
          Insert the method's description here.
static void main(java.lang.String[] args)
           
 void setUp()
          Insert the method's description here.
 void tearDown()
          Insert the method's description here.
 void testCollectionRetrieval()
          Insert the method's description here.
 void testModifications()
          Insert the method's description here.
 void testObjectCache()
          here we see what a good job the ObjectCache does: if the Cache has not been flushed by the GC, All previously loaded Objects are still hot.
 void testRetrieveAllReferences()
          tests the PB.retrieveAllReferences() feature
 void testRetrieveReference()
          tests the PB.retrieveReference() feature
 void testShallowAndDeepRetrieval()
          here we see what a good job the ObjectCache does: if the Cache has not been flushed by the GC, All previously loaded Objects are still hot.
 
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

BrokerExamples

public BrokerExamples(java.lang.String name)
Insert the method's description here. Creation date: (24.12.2000 00:33:40)

Method Detail

main

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

createArticle

protected Article createArticle(int id)
Insert the method's description here. Creation date: (06.12.2000 22:15:33)

Parameters:
id - int

setUp

public void setUp()
           throws PBFactoryException
Insert the method's description here. Creation date: (06.12.2000 21:58:53)

Throws:
PBFactoryException

tearDown

public void tearDown()
Insert the method's description here. Creation date: (06.12.2000 21:59:14)


testCollectionRetrieval

public void testCollectionRetrieval()
                             throws java.lang.Exception
Insert the method's description here. Creation date: (23.12.2000 20:05:49)

Throws:
java.lang.Exception

testModifications

public void testModifications()
                       throws java.lang.Exception
Insert the method's description here. Creation date: (23.12.2000 20:05:49)

Throws:
java.lang.Exception

testObjectCache

public void testObjectCache()
                     throws java.lang.Exception
here we see what a good job the ObjectCache does: if the Cache has not been flushed by the GC, All previously loaded Objects are still hot. I.e. they are reloaded from the Cache and not materialized from the RDBMS

Throws:
java.lang.Exception

createSimpleArticle

protected Article createSimpleArticle(int id)
Insert the method's description here. Creation date: (06.12.2000 22:15:33)

Parameters:
id - int

testShallowAndDeepRetrieval

public void testShallowAndDeepRetrieval()
                                 throws java.lang.Exception
here we see what a good job the ObjectCache does: if the Cache has not been flushed by the GC, All previously loaded Objects are still hot. I.e. they are reloaded from the Cache and not materialized from the RDBMS

Throws:
java.lang.Exception

testRetrieveReference

public void testRetrieveReference()
                           throws java.lang.Exception
tests the PB.retrieveReference() feature

Throws:
java.lang.Exception

testRetrieveAllReferences

public void testRetrieveAllReferences()
tests the PB.retrieveAllReferences() feature



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