directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1467333 - /directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ppolicy/PasswordPolicyIT.java
Date Fri, 12 Apr 2013 16:16:06 GMT
Author: elecharny
Date: Fri Apr 12 16:16:05 2013
New Revision: 1467333

URL: http://svn.apache.org/r1467333
Log:
Added an ignored test for the pwdMin/MaxDelay

Modified:
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ppolicy/PasswordPolicyIT.java

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ppolicy/PasswordPolicyIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ppolicy/PasswordPolicyIT.java?rev=1467333&r1=1467332&r2=1467333&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ppolicy/PasswordPolicyIT.java
(original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ppolicy/PasswordPolicyIT.java
Fri Apr 12 16:16:05 2013
@@ -973,4 +973,42 @@ public class PasswordPolicyIT extends Ab
         userConnection.close();
         adminConnection.close();
     }
+
+
+    /**
+     * Check the minDelay/maxDelay.
+     */
+    @Test
+    @Ignore("Failing test atm")
+    public void testPwdMinMaxDelay() throws Exception
+    {
+        policyConfig.setPwdMinDelay( 2 );
+        policyConfig.setPwdMaxDelay( 16 );
+
+        Dn userDn = new Dn( "cn=userLockout4,ou=system" );
+        LdapConnection adminConnection = getAdminNetworkConnection( getLdapServer() );
+
+        addUser( adminConnection, userDn, "12345" );
+
+        LdapConnection userConnection = new LdapNetworkConnection( "localhost", ldapServer.getPort()
);
+        userConnection.setTimeOut( 0L );
+
+        // First attempt
+        long t0 = System.currentTimeMillis();
+        long t1 = 0L;
+
+        try
+        {
+            userConnection.bind( userDn, "badPassword" );
+        }
+        catch ( LdapAuthenticationException le )
+        {
+            t0 = System.currentTimeMillis();
+        }
+
+        assertTrue( 1 < ( t1 - t0 ) );
+
+        userConnection.close();
+        adminConnection.close();
+    }
 }



Mime
View raw message