directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r1067438 - /directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/SimpleBindRequestTest.java
Date Sat, 05 Feb 2011 13:07:31 GMT
Author: seelmann
Date: Sat Feb  5 13:07:31 2011
New Revision: 1067438

URL: http://svn.apache.org/viewvc?rev=1067438&view=rev
Log:
Removed loop in test

Modified:
    directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/SimpleBindRequestTest.java

Modified: directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/SimpleBindRequestTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/SimpleBindRequestTest.java?rev=1067438&r1=1067437&r2=1067438&view=diff
==============================================================================
--- directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/SimpleBindRequestTest.java
(original)
+++ directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/SimpleBindRequestTest.java
Sat Feb  5 13:07:31 2011
@@ -155,63 +155,59 @@ public class SimpleBindRequestTest exten
     @Test
     public void testSimpleBindAnonymous() throws Exception
     {
-        for ( int i = 0; i < 5; i++ )
-        {
-            //System.out.println( "------------------Create connection" + i + "-------------"
);
-            LdapConnection connection = new LdapNetworkConnection( "localhost", ldapServer.getPort()
);
-            //System.out.println( "------------------Bind" + i + "-------------" );
-
-            // Try with no parameters
-            BindResponse bindResponse = connection.bind();
-
-            assertNotNull( bindResponse );
-            assertNotNull( bindResponse.getLdapResult() );
-            assertEquals( ResultCodeEnum.SUCCESS, bindResponse.getLdapResult().getResultCode()
);
-            assertEquals( 1, bindResponse.getMessageId() );
-            assertTrue( connection.isAuthenticated() );
-
-            //System.out.println( "----------------Unbind" + i + "-------------" );
-            connection.unBind();
-            assertFalse( connection.isConnected() );
-            connection.close();
-
-            // Try with empty strings
-            connection = new LdapNetworkConnection( "localhost", ldapServer.getPort() );
-            bindResponse = connection.bind( "", "" );
-
-            assertNotNull( bindResponse );
-            assertNotNull( bindResponse.getLdapResult() );
-            assertEquals( ResultCodeEnum.SUCCESS, bindResponse.getLdapResult().getResultCode()
);
-            assertEquals( 1, bindResponse.getMessageId() );
-            assertTrue( connection.isAuthenticated() );
-
-            connection.unBind();
-            assertFalse( connection.isConnected() );
-            connection.close();
-
-            // Try with null parameters
-            connection = new LdapNetworkConnection( "localhost", ldapServer.getPort() );
-            bindResponse = connection.bind( ( String ) null, ( String ) null );
-
-            assertNotNull( bindResponse );
-            assertNotNull( bindResponse.getLdapResult() );
-            assertEquals( ResultCodeEnum.SUCCESS, bindResponse.getLdapResult().getResultCode()
);
-            assertEquals( 1, bindResponse.getMessageId() );
-            assertTrue( connection.isAuthenticated() );
-            assertTrue( connection.isConnected() );
-
-            connection.unBind();
-            assertFalse( connection.isConnected() );
-            connection.close();
-
-            connection = new LdapNetworkConnection( "localhost", ldapServer.getPort() );
-
-            //System.out.println( "----------------Unbind done" + i + "-------------" );
-            assertFalse( connection.isConnected() );
-            connection.close();
-            //System.out.println( "----------------Unconnected" + i + "-------------" );
+        //System.out.println( "------------------Create connection" + i + "-------------"
);
+        LdapConnection connection = new LdapNetworkConnection( "localhost", ldapServer.getPort()
);
+        //System.out.println( "------------------Bind" + i + "-------------" );
 
-        }
+        // Try with no parameters
+        BindResponse bindResponse = connection.bind();
+
+        assertNotNull( bindResponse );
+        assertNotNull( bindResponse.getLdapResult() );
+        assertEquals( ResultCodeEnum.SUCCESS, bindResponse.getLdapResult().getResultCode()
);
+        assertEquals( 1, bindResponse.getMessageId() );
+        assertTrue( connection.isAuthenticated() );
+
+        //System.out.println( "----------------Unbind" + i + "-------------" );
+        connection.unBind();
+        assertFalse( connection.isConnected() );
+        connection.close();
+
+        // Try with empty strings
+        connection = new LdapNetworkConnection( "localhost", ldapServer.getPort() );
+        bindResponse = connection.bind( "", "" );
+
+        assertNotNull( bindResponse );
+        assertNotNull( bindResponse.getLdapResult() );
+        assertEquals( ResultCodeEnum.SUCCESS, bindResponse.getLdapResult().getResultCode()
);
+        assertEquals( 1, bindResponse.getMessageId() );
+        assertTrue( connection.isAuthenticated() );
+
+        connection.unBind();
+        assertFalse( connection.isConnected() );
+        connection.close();
+
+        // Try with null parameters
+        connection = new LdapNetworkConnection( "localhost", ldapServer.getPort() );
+        bindResponse = connection.bind( ( String ) null, ( String ) null );
+
+        assertNotNull( bindResponse );
+        assertNotNull( bindResponse.getLdapResult() );
+        assertEquals( ResultCodeEnum.SUCCESS, bindResponse.getLdapResult().getResultCode()
);
+        assertEquals( 1, bindResponse.getMessageId() );
+        assertTrue( connection.isAuthenticated() );
+        assertTrue( connection.isConnected() );
+
+        connection.unBind();
+        assertFalse( connection.isConnected() );
+        connection.close();
+
+        connection = new LdapNetworkConnection( "localhost", ldapServer.getPort() );
+
+        //System.out.println( "----------------Unbind done" + i + "-------------" );
+        assertFalse( connection.isConnected() );
+        connection.close();
+        //System.out.println( "----------------Unconnected" + i + "-------------" );
     }
 
 



Mime
View raw message