org.apache.commons.id.serial
Class TimeBasedAlphanumericIdentifierGeneratorTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.commons.id.serial.TimeBasedAlphanumericIdentifierGeneratorTest
All Implemented Interfaces:
junit.framework.Test

public class TimeBasedAlphanumericIdentifierGeneratorTest
extends junit.framework.TestCase

Author:
Commons-Id team

Constructor Summary
TimeBasedAlphanumericIdentifierGeneratorTest()
           
 
Method Summary
static junit.framework.TestSuite suite()
          TestSuite for TimeBasedAlphanumericIdentifierGenerator.
 void testCanRetrieveTimeFromIdWithInternalOverflow()
          Test ensures, that generator can recalculate the time from the id even if internally an overflow had happened.
 void testCanRetrieveTimeFromIdWithoutInternalOverflow()
          Test ensures, that generator can recalculate the time from the id if internally no overflow had happened.
 void testDefaultPostfixSizeIsGoodEnough()
          Ensure that the default postfix size is big enough for a lot faster computers.
 void testDifferentGeneratorInstancesWillProduceStillUniqueIds()
          Test if different instances of the generator still deliver unique ids.
 void testIdentifierSizeIsConstant()
          Test constant size of generated identifier.
 void testIllegalPostfixSize()
          Test illegal values for the postfix size.
 void testIllegalStateWhenTooManyIdentifiersGenerated()
          Test that an IllegalStateException is thrown if no more unique identifiers can be generated.
 void testInternalOverflowStillIncreasesIds()
          Test if generator can handle an internal overflow as it may happen for time values and still delivers increasing ids.
 void testMayStartWithIdentifierOfZeros()
          Test that the generator can be tweaked to start with '0'.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, 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

TimeBasedAlphanumericIdentifierGeneratorTest

public TimeBasedAlphanumericIdentifierGeneratorTest()
Method Detail

testIdentifierSizeIsConstant

public void testIdentifierSizeIsConstant()
Test constant size of generated identifier.


testIllegalPostfixSize

public void testIllegalPostfixSize()
Test illegal values for the postfix size.


testIllegalStateWhenTooManyIdentifiersGenerated

public void testIllegalStateWhenTooManyIdentifiersGenerated()
Test that an IllegalStateException is thrown if no more unique identifiers can be generated.


testMayStartWithIdentifierOfZeros

public void testMayStartWithIdentifierOfZeros()
Test that the generator can be tweaked to start with '0'.


testDefaultPostfixSizeIsGoodEnough

public void testDefaultPostfixSizeIsGoodEnough()
Ensure that the default postfix size is big enough for a lot faster computers.


testInternalOverflowStillIncreasesIds

public void testInternalOverflowStillIncreasesIds()
Test if generator can handle an internal overflow as it may happen for time values and still delivers increasing ids.


testCanRetrieveTimeFromIdWithoutInternalOverflow

public void testCanRetrieveTimeFromIdWithoutInternalOverflow()
Test ensures, that generator can recalculate the time from the id if internally no overflow had happened.


testCanRetrieveTimeFromIdWithInternalOverflow

public void testCanRetrieveTimeFromIdWithInternalOverflow()
Test ensures, that generator can recalculate the time from the id even if internally an overflow had happened.


testDifferentGeneratorInstancesWillProduceStillUniqueIds

public void testDifferentGeneratorInstancesWillProduceStillUniqueIds()
Test if different instances of the generator still deliver unique ids.


suite

public static junit.framework.TestSuite suite()
TestSuite for TimeBasedAlphanumericIdentifierGenerator. Ensures serialization.

Returns:
the TestSuite


Copyright © 2003-2008 The Apache Software Foundation. All Rights Reserved.