org.apache.ojb.broker.sequence
Class SequenceManagerTest

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

public class SequenceManagerTest
extends junit.framework.TestCase

Tests to verify SequenceManager implementations - All sequence manager implementations have to pass these tests without failures.
Note: For the multi-threaded tests, the keys will be generated once for all tests.

Version:
$Id: SequenceManagerTest.java,v 1.26 2003/11/06 01:38:16 arminw Exp $
Author:
Armin Waibel

Nested Class Summary
static class SequenceManagerTest.AbstractSMObject
           
static class SequenceManagerTest.SMAutoNaming
           
static class SequenceManagerTest.SMObjectOne
           
static class SequenceManagerTest.SMObjectTwo
           
 
Constructor Summary
SequenceManagerTest(java.lang.String s)
           
 
Method Summary
protected static void addResultList(java.util.List resultList)
           
protected static void countKey()
           
static void main(java.lang.String[] args)
           
protected  void setUp()
           
protected  void tearDown()
           
 void testAutoNaming()
           
 void testDatabaseSequenceGeneration()
          This test only works, when using SequenceManagerNextValImpl for sequence generation.
 void testForLostKeys()
          Tests to detect the lost of sequence numbers in multi-threaded environments.
 void testGetUniqueIdWithOneBroker()
          test case written by a user
 void testMassStoreOfObjects()
           
 void testMaxKeySearch1()
          Test the max id search used in the standard sequence manager implementations.
 void testMaxKeySearch2()
          Test the max id search used in the standard sequence manager implementations.
 void testMaxKeySearch3()
          Test the max id search used in the standard sequence manager implementations.
 void testMultipleAutoincrement()
          Test support for classes with multiple autoincrement fields - e.g.
 void testObjectsFromAbstractBaseClass1()
           
 void testObjectsFromAbstractBaseClass2()
           
 void testSequenceGeneration()
          Tests the generation of unique sequence numbers in multi-threaded environment.
 void testSequenceNameAttribute()
          Test the use of the 'sequence-name' field descriptor attribute.
 void testUniqueAcrossExtendsWithDifferentTables1()
          Tests if the generated id's are unique across extents.
 void testUniqueAcrossExtendsWithDifferentTables2()
          Tests if the generated id's are unique across extents.
 void testUniqueAcrossExtendsWithDifferentTables3()
          Tests if the generated id's are unique across extents.
 void testUniqueAcrossExtendsWithSameTable1()
          Tests if the generated id's are unique across extents.
 void testUniqueAcrossExtendsWithSameTable3()
          Tests if the generated id's are unique across extents.
 void testUniqueAcrossExtendsWithSameTable4()
          Tests if the generated id's are unique across extents.
 void testUniqueAcrossExtendsWithSameTable5()
          Tests if the generated id's are unique across extents.
 void YYYtest_getUniqueIdWithTwoBrokers()
          Test for unique **continuous** key generation across different PB instances.
 void YYYtestSequenceManagerStoredProcedureImpl()
          Test case for internal use while developing! Was commented out by default!
 
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

SequenceManagerTest

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

main

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

setUp

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

tearDown

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

testMultipleAutoincrement

public void testMultipleAutoincrement()
Test support for classes with multiple autoincrement fields - e.g. see repository for Repository.SMKey


testSequenceNameAttribute

public void testSequenceNameAttribute()
                               throws java.lang.Exception
Test the use of the 'sequence-name' field descriptor attribute.

Throws:
java.lang.Exception

testAutoNaming

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

testDatabaseSequenceGeneration

public void testDatabaseSequenceGeneration()
                                    throws java.lang.Exception
This test only works, when using SequenceManagerNextValImpl for sequence generation.

Throws:
java.lang.Exception

testMaxKeySearch1

public void testMaxKeySearch1()
Test the max id search used in the standard sequence manager implementations.


testMaxKeySearch2

public void testMaxKeySearch2()
Test the max id search used in the standard sequence manager implementations.


testMaxKeySearch3

public void testMaxKeySearch3()
Test the max id search used in the standard sequence manager implementations.


testUniqueAcrossExtendsWithDifferentTables1

public void testUniqueAcrossExtendsWithDifferentTables1()
                                                 throws java.lang.Exception
Tests if the generated id's are unique across extents.

Throws:
java.lang.Exception

testUniqueAcrossExtendsWithDifferentTables2

public void testUniqueAcrossExtendsWithDifferentTables2()
                                                 throws java.lang.Exception
Tests if the generated id's are unique across extents.

Throws:
java.lang.Exception

testUniqueAcrossExtendsWithDifferentTables3

public void testUniqueAcrossExtendsWithDifferentTables3()
                                                 throws java.lang.Exception
Tests if the generated id's are unique across extents.

Throws:
java.lang.Exception

testUniqueAcrossExtendsWithSameTable1

public void testUniqueAcrossExtendsWithSameTable1()
                                           throws java.lang.Exception
Tests if the generated id's are unique across extents.

Throws:
java.lang.Exception

testUniqueAcrossExtendsWithSameTable3

public void testUniqueAcrossExtendsWithSameTable3()
                                           throws java.lang.Exception
Tests if the generated id's are unique across extents.

Throws:
java.lang.Exception

testUniqueAcrossExtendsWithSameTable4

public void testUniqueAcrossExtendsWithSameTable4()
                                           throws java.lang.Exception
Tests if the generated id's are unique across extents.

Throws:
java.lang.Exception

testUniqueAcrossExtendsWithSameTable5

public void testUniqueAcrossExtendsWithSameTable5()
                                           throws java.lang.Exception
Tests if the generated id's are unique across extents.

Throws:
java.lang.Exception

testGetUniqueIdWithOneBroker

public void testGetUniqueIdWithOneBroker()
                                  throws java.lang.Exception
test case written by a user

Throws:
java.lang.Exception

testSequenceGeneration

public void testSequenceGeneration()
Tests the generation of unique sequence numbers in multi-threaded environment.


testForLostKeys

public void testForLostKeys()
Tests to detect the lost of sequence numbers in multi-threaded environments.


YYYtest_getUniqueIdWithTwoBrokers

public void YYYtest_getUniqueIdWithTwoBrokers()
                                       throws java.lang.Exception
Test for unique **continuous** key generation across different PB instances. test case was written by a user - thanks. this test was *commented out* by default, because not all sequence manager implementations generate continuous keys across different PB instances.

Throws:
java.lang.Exception

YYYtestSequenceManagerStoredProcedureImpl

public void YYYtestSequenceManagerStoredProcedureImpl()
                                               throws java.lang.Exception
Test case for internal use while developing! Was commented out by default!

Throws:
java.lang.Exception

addResultList

protected static void addResultList(java.util.List resultList)

countKey

protected static void countKey()

testObjectsFromAbstractBaseClass1

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

testObjectsFromAbstractBaseClass2

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

testMassStoreOfObjects

public void testMassStoreOfObjects()


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