You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by rw...@apache.org on 2005/08/07 17:40:49 UTC

svn commit: r230674 - /portals/jetspeed-2/trunk/components/security/src/test/org/apache/jetspeed/security/spi/TestInternalPasswordCredentialHistoryHandlingInterceptor.java

Author: rwatler
Date: Sun Aug  7 08:40:47 2005
New Revision: 230674

URL: http://svn.apache.org/viewcvs?rev=230674&view=rev
Log:
add pauses to test to force differing timestamps for password history

Modified:
    portals/jetspeed-2/trunk/components/security/src/test/org/apache/jetspeed/security/spi/TestInternalPasswordCredentialHistoryHandlingInterceptor.java

Modified: portals/jetspeed-2/trunk/components/security/src/test/org/apache/jetspeed/security/spi/TestInternalPasswordCredentialHistoryHandlingInterceptor.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/security/src/test/org/apache/jetspeed/security/spi/TestInternalPasswordCredentialHistoryHandlingInterceptor.java?rev=230674&r1=230673&r2=230674&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/security/src/test/org/apache/jetspeed/security/spi/TestInternalPasswordCredentialHistoryHandlingInterceptor.java (original)
+++ portals/jetspeed-2/trunk/components/security/src/test/org/apache/jetspeed/security/spi/TestInternalPasswordCredentialHistoryHandlingInterceptor.java Sun Aug  7 08:40:47 2005
@@ -60,12 +60,18 @@
 
     public void testPasswordHistory() throws Exception
     {
+        // note that the automated test here must wait between
+        // create user and set password operations to ensure that
+        // passwords get unique timestamps
         assertTrue("should be allowed to authenticate",ums.authenticate("testcred","password"));
+        Thread.sleep(10);
         ums.setPassword("testcred","password","password1");
+        Thread.sleep(10);
         ums.setPassword("testcred","password1","password2");
         assertTrue("should be allowed to authenticate",ums.authenticate("testcred","password2"));
         try
         {
+            Thread.sleep(10);
             ums.setPassword("testcred","password2","password");
             fail("Should not be allowed to reuse a password from password history");
         }
@@ -73,8 +79,11 @@
         {
             assertTrue(SecurityException.PASSWORD_ALREADY_USED.equals(sex.getKeyedMessage()));
         }
+        Thread.sleep(10);
         ums.setPassword("testcred","password2","password3");
+        Thread.sleep(10);
         ums.setPassword("testcred","password3","password4");
+        Thread.sleep(10);
         ums.setPassword("testcred","password4","password");
         assertTrue("should be allowed to authenticate",ums.authenticate("testcred","password"));
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org