org.apache.ojb.broker
Class PersistenceBrokerTest

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

public class PersistenceBrokerTest
extends junit.framework.TestCase

Junit test driver for elematary PB tests.


Field Summary
(package private)  PersistenceBroker broker
           
(package private)  int testId
           
 
Constructor Summary
PersistenceBrokerTest(java.lang.String name)
          BrokerTests constructor comment.
 
Method Summary
protected  Article createArticle(int id)
           
protected  CdArticle createCdArticle(int id)
           
protected  void deleteArticle(Article articleToDelete)
          Insert the method's description here.
protected  void deleteArticle(int id)
          Insert the method's description here.
static void main(java.lang.String[] args)
           
protected  Article readArticleByExample(int id)
          Insert the method's description here.
protected  Article readArticleByIdentity(int id)
          Insert the method's description here.
 void setUp()
           
protected  void storeArticle(Article anArticle)
          Insert the method's description here.
 void tearDown()
           
 void testAutoIncrement()
          Test the AutoIncrement facility
 void testChangeFieldsWhileStoringObject()
           
 void testCountByReportQuery()
          do a count by report query
 void testDelete()
          test the the PB delete() method.
 void testDeleteByQuery()
          test the the PB deleteByQuery() method.
 void testDoubleDelete()
           
 void testDoubleStore()
           
 void testDuplicateExtentQueries()
          Test if only one query is executed for each extent.
If the same query is run multiple times the result will contain duplicates
 void testEscaping()
          Insert the method's description here.
 void testExtentAwareIteratorByQuery()
          extent aware iterator
 void testExtentWithOneConcreteClassWithOjbConcreteClass()
          performs a test of an extent with one concrete class that uses ojbConcreteClass identifier.
 void testGetByExampleAndGetByIdentity()
          Insert the method's description here.
 void testGetCollectionByQuery()
          Insert the method's description here.
 void testGetCollectionByQueryWithStartAndEnd()
           
 void testGetDescriptor()
          performs a test to check if metadata can be read
 void testGetIteratorByQuery()
          Insert the method's description here.
 void testGetIteratorBySQL()
          Testing the getIteratorBySQL functionality
 void testGetMultipleIteratorsByQuery()
          Insert the method's description here.
 void testGetObjectByQuery()
          Insert the method's description here.
 void testGetPKEnumerationByConstraints()
          Insert the method's description here.
 void testGetReportQueryIteratorBySQL()
          Testing the getReportQueryIteratorBySQL functionality
 void testGuidFieldConversion()
          tests the FieldConversion facility
 void testInsert()
          Insert the method's description here.
 void testIteratorSize()
          Size returned by Iterator must be same as size of Collection
 void testMappingToOneTable()
          performs a test of the inheritance mapping to one table.
 void testMappingToOneTableWithAbstractBaseClass()
          performs a test of the inheritance mapping to one table.
 void testNull_0_Complex_2()
          Object with autoincrement 'true' and a NON primitive data type for the PK field.
 void testNull_0_Complex()
          PK fields with primitive data types interpret '0' value as 'null' by default.
 void testPaging()
           
 void testPagingEmptyIterator()
           
 void testPagingEndIndexOutOfRange()
           
 void testPagingIndicesOutOfRange()
           
 void testPBF()
           
 void testPBisClosed()
           
 void testReadUncommitedDataWithinSamePB()
           
 void testRowReader()
          tests the RowReader mechanism
 void testSortedCollectionAttribute()
          testing the sorted collections feature.)
 void testSorting()
          Insert the method's description here.
 void testUpdate()
          Insert the method's description here.
 void testUpdateReferencedProxy()
          test if reference to Proxy is updated
 void testUpdateWithModification()
          Insert the method's description here.
 
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

testId

int testId
Constructor Detail

PersistenceBrokerTest

public PersistenceBrokerTest(java.lang.String name)
BrokerTests constructor comment.

Parameters:
name - java.lang.String
Method Detail

main

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

setUp

public void setUp()

tearDown

public void tearDown()

testReadUncommitedDataWithinSamePB

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

testNull_0_Complex

public void testNull_0_Complex()
                        throws java.lang.Exception
PK fields with primitive data types interpret '0' value as 'null' by default. But if we don't use primitive data types and read an object with 0 as PK value and store such an object without changes, nothing should happen.

Throws:
java.lang.Exception

testNull_0_Complex_2

public void testNull_0_Complex_2()
                          throws java.lang.Exception
Object with autoincrement 'true' and a NON primitive data type for the PK field. It should be allowed to set an new object with PK 0, because PK field is not primitive

Throws:
java.lang.Exception

testPBF

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

createArticle

protected Article createArticle(int id)

createCdArticle

protected CdArticle createCdArticle(int id)

deleteArticle

protected void deleteArticle(int id)
                      throws PersistenceBrokerException
Insert the method's description here. Creation date: (06.12.2000 22:15:33)

Parameters:
id - int
Throws:
PersistenceBrokerException

deleteArticle

protected void deleteArticle(Article articleToDelete)
                      throws PersistenceBrokerException
Insert the method's description here. Creation date: (06.12.2000 22:15:33)

Parameters:
articleToDelete - int
Throws:
PersistenceBrokerException

readArticleByExample

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

Parameters:
id - int
Throws:
PersistenceBrokerException

readArticleByIdentity

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

Parameters:
id - int
Throws:
PersistenceBrokerException

storeArticle

protected void storeArticle(Article anArticle)
                     throws PersistenceBrokerException
Insert the method's description here. Creation date: (06.12.2000 22:15:33)

Parameters:
anArticle - int
Throws:
PersistenceBrokerException

testDelete

public void testDelete()
                throws java.lang.Exception
test the the PB delete() method.

Throws:
java.lang.Exception

testPBisClosed

public void testPBisClosed()

testDeleteByQuery

public void testDeleteByQuery()
                       throws java.lang.Exception
test the the PB deleteByQuery() method.

Throws:
java.lang.Exception

testMappingToOneTableWithAbstractBaseClass

public void testMappingToOneTableWithAbstractBaseClass()
performs a test of the inheritance mapping to one table.


testExtentWithOneConcreteClassWithOjbConcreteClass

public void testExtentWithOneConcreteClassWithOjbConcreteClass()
                                                        throws java.lang.Exception
performs a test of an extent with one concrete class that uses ojbConcreteClass identifier.

Throws:
java.lang.Exception

testMappingToOneTable

public void testMappingToOneTable()
                           throws java.lang.Exception
performs a test of the inheritance mapping to one table.

Throws:
java.lang.Exception

testGetDescriptor

public void testGetDescriptor()
                       throws java.lang.Exception
performs a test to check if metadata can be read

Throws:
java.lang.Exception

testGuidFieldConversion

public void testGuidFieldConversion()
tests the FieldConversion facility


testRowReader

public void testRowReader()
tests the RowReader mechanism


testEscaping

public void testEscaping()
                  throws java.lang.Exception
Insert the method's description here. Creation date: (06.12.2000 21:51:22)

Throws:
java.lang.Exception

testGetByExampleAndGetByIdentity

public void testGetByExampleAndGetByIdentity()
                                      throws java.lang.Exception
Insert the method's description here. Creation date: (06.12.2000 21:51:22)

Throws:
java.lang.Exception

testGetCollectionByQuery

public void testGetCollectionByQuery()
                              throws java.lang.Exception
Insert the method's description here. Creation date: (06.12.2000 21:51:22)

Throws:
java.lang.Exception

testGetCollectionByQueryWithStartAndEnd

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

testSorting

public void testSorting()
                 throws java.lang.Exception
Insert the method's description here. Creation date: (06.12.2000 21:51:22)

Throws:
java.lang.Exception

testSortedCollectionAttribute

public void testSortedCollectionAttribute()
testing the sorted collections feature.)


testAutoIncrement

public void testAutoIncrement()
                       throws java.lang.Exception
Test the AutoIncrement facility

Throws:
java.lang.Exception

testCountByReportQuery

public void testCountByReportQuery()
                            throws java.lang.Exception
do a count by report query

Throws:
java.lang.Exception

testExtentAwareIteratorByQuery

public void testExtentAwareIteratorByQuery()
                                    throws java.lang.Exception
extent aware iterator

Throws:
java.lang.Exception

testGetIteratorByQuery

public void testGetIteratorByQuery()
                            throws java.lang.Exception
Insert the method's description here. Creation date: (06.12.2000 21:51:22)

Throws:
java.lang.Exception

testGetIteratorBySQL

public void testGetIteratorBySQL()
                          throws java.lang.Exception
Testing the getIteratorBySQL functionality

Throws:
java.lang.Exception

testGetReportQueryIteratorBySQL

public void testGetReportQueryIteratorBySQL()
Testing the getReportQueryIteratorBySQL functionality


testGetMultipleIteratorsByQuery

public void testGetMultipleIteratorsByQuery()
                                     throws java.lang.Exception
Insert the method's description here. Creation date: (06.12.2000 21:51:22)

Throws:
java.lang.Exception

testGetObjectByQuery

public void testGetObjectByQuery()
                          throws java.lang.Exception
Insert the method's description here. Creation date: (06.12.2000 21:51:22)

Throws:
java.lang.Exception

testGetPKEnumerationByConstraints

public void testGetPKEnumerationByConstraints()
                                       throws java.lang.Exception
Insert the method's description here. Creation date: (06.12.2000 21:51:22)

Throws:
java.lang.Exception

testInsert

public void testInsert()
                throws java.lang.Exception
Insert the method's description here. Creation date: (06.12.2000 21:51:22)

Throws:
java.lang.Exception

testUpdate

public void testUpdate()
                throws java.lang.Exception
Insert the method's description here. Creation date: (06.12.2000 21:51:22)

Throws:
java.lang.Exception

testUpdateWithModification

public void testUpdateWithModification()
                                throws java.lang.Exception
Insert the method's description here. Creation date: (06.12.2000 21:51:22)

Throws:
java.lang.Exception

testUpdateReferencedProxy

public void testUpdateReferencedProxy()
                               throws java.lang.Exception
test if reference to Proxy is updated

Throws:
java.lang.Exception

testChangeFieldsWhileStoringObject

public void testChangeFieldsWhileStoringObject()

testDoubleStore

public void testDoubleStore()

testDoubleDelete

public void testDoubleDelete()

testDuplicateExtentQueries

public void testDuplicateExtentQueries()
Test if only one query is executed for each extent.
If the same query is run multiple times the result will contain duplicates


testIteratorSize

public void testIteratorSize()
Size returned by Iterator must be same as size of Collection


testPaging

public void testPaging()

testPagingIndicesOutOfRange

public void testPagingIndicesOutOfRange()

testPagingEndIndexOutOfRange

public void testPagingEndIndexOutOfRange()

testPagingEmptyIterator

public void testPagingEmptyIterator()


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