You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2019/05/09 22:40:23 UTC

[directory-server] 03/03: Slightly improve the test that loop on bind/unbind to avoid printing thousands of lines

This is an automated email from the ASF dual-hosted git repository.

elecharny pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/directory-server.git

commit 9f3401f320781998c1b091424d110884dc6c3f59
Author: emmanuel lecharny <el...@apache.org>
AuthorDate: Fri May 10 00:40:15 2019 +0200

    Slightly improve the test that loop on bind/unbind to avoid printing
    thousands of lines
---
 .../client/api/operations/bind/SimpleBindRequestTest.java   |  7 +++++--
 .../directory/server/operations/bind/SimpleBindIT.java      | 13 ++++++++++---
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/SimpleBindRequestTest.java b/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/SimpleBindRequestTest.java
index f2a6bce..102e4c7 100644
--- a/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/SimpleBindRequestTest.java
+++ b/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/SimpleBindRequestTest.java
@@ -658,9 +658,12 @@ public class SimpleBindRequestTest extends AbstractLdapTestUnit
     @Test
     public void testSimpleBindAndUnbindLoop() throws Exception
     {
-        for ( int i = 0; i < 10000; i++ )
+        for ( int i = 0; i < 1000; i++ )
         {
-            System.out.println( i );
+            if ( i % 100 == 0 )
+            {
+                System.out.println( i );
+            }
 
             connection.bind( "uid=admin,ou=system", "secret" );
             assertTrue( connection.isAuthenticated() );
diff --git a/server-integ/src/test/java/org/apache/directory/server/operations/bind/SimpleBindIT.java b/server-integ/src/test/java/org/apache/directory/server/operations/bind/SimpleBindIT.java
index cdc3ad8..30a3ad8 100644
--- a/server-integ/src/test/java/org/apache/directory/server/operations/bind/SimpleBindIT.java
+++ b/server-integ/src/test/java/org/apache/directory/server/operations/bind/SimpleBindIT.java
@@ -523,12 +523,16 @@ public class SimpleBindIT extends AbstractLdapTestUnit
     @Test
     public void testSimpleBindAndUnbindLoop() throws Exception
     {
+        long t0 = System.currentTimeMillis();
         try ( LdapNetworkConnection connection = new LdapNetworkConnection( Network.LOOPBACK_HOSTNAME,
             getLdapServer().getPort() ) )
         {
-            for ( int i = 0; i < 10000; i++ )
+            for ( int i = 0; i < 1000; i++ )
             {
-                System.out.println( i );
+                if ( i % 100 == 0 )
+                {
+                    System.out.println( i );
+                }
 
                 connection.bind( "uid=admin,ou=system", "secret" );
                 assertTrue( connection.isAuthenticated() );
@@ -536,9 +540,12 @@ public class SimpleBindIT extends AbstractLdapTestUnit
                 connection.unBind();
                 assertFalse( connection.isAuthenticated() );
 
-                // Thread.sleep( 10L );
+                // Thread.sleep( 2L );
             }
         }
+        long t1 = System.currentTimeMillis();
+        
+        System.out.println( "Delta = " + ( t1 - t0 ) );
     }
 
 }