Author: joehni
Date: Sat Aug 19 11:22:22 2006
New Revision: 432853

URL: http://svn.apache.org/viewvc?rev=432853&view=rev
Log:
Force IllegalStateException even for time shifts.

Modified:
    
jakarta/commons/sandbox/id/trunk/src/test/org/apache/commons/id/serial/TimeBasedAlphanumericIdentifierGeneratorTest.java

Modified: 
jakarta/commons/sandbox/id/trunk/src/test/org/apache/commons/id/serial/TimeBasedAlphanumericIdentifierGeneratorTest.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/sandbox/id/trunk/src/test/org/apache/commons/id/serial/TimeBasedAlphanumericIdentifierGeneratorTest.java?rev=432853&r1=432852&r2=432853&view=diff
==============================================================================
--- 
jakarta/commons/sandbox/id/trunk/src/test/org/apache/commons/id/serial/TimeBasedAlphanumericIdentifierGeneratorTest.java
 (original)
+++ 
jakarta/commons/sandbox/id/trunk/src/test/org/apache/commons/id/serial/TimeBasedAlphanumericIdentifierGeneratorTest.java
 Sat Aug 19 11:22:22 2006
@@ -85,8 +85,11 @@
         try {
             idGenerator.nextIdentifier();
             idGenerator.nextIdentifier();
-            // ensure exception even if a new time slice has been started 
between the last two calls
-            idGenerator.nextIdentifier();
+            // Normally this should have been enough. Unfortunately the test 
fails, if the OS is doing
+            // forward time shifts, then we get new ids anyway. So force the 
exception ...
+            for(int i = 1000; i-- > 0; ) {
+                idGenerator.nextIdentifier();
+            }
             fail("Thrown " + IllegalStateException.class.getName() + " 
expected");
         } catch (final IllegalStateException e) {
             // OK



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to