directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r1681476 - /directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ApacheDSPluginTest.java
Date Sun, 24 May 2015 15:30:08 GMT
Author: seelmann
Date: Sun May 24 15:30:08 2015
New Revision: 1681476

URL: http://svn.apache.org/r1681476
Log:
Simplify port allocation

Modified:
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ApacheDSPluginTest.java

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ApacheDSPluginTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ApacheDSPluginTest.java?rev=1681476&r1=1681475&r2=1681476&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ApacheDSPluginTest.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ApacheDSPluginTest.java
Sun May 24 15:30:08 2015
@@ -236,22 +236,15 @@ public class ApacheDSPluginTest
     private void setAvailablePorts( String serverName )
     {
         ApacheDSConfigurationEditorBot editorBot = serversViewBot.openConfigurationEditor(
serverName );
-        editorBot.setLdapPort( getAvailablePort() );
-        editorBot.setLdapsPort( getAvailablePort() );
-        editorBot.save();
-        editorBot.close();
-    }
 
+        int ldapPort = AvailablePortFinder.getNextAvailable( 1024 );
+        editorBot.setLdapPort( ldapPort );
 
-    private int getAvailablePort()
-    {
-        int port;
-        do
-        {
-            port = AvailablePortFinder.getNextAvailable();
-        }
-        while ( port < AvailablePortFinder.MIN_PORT_NUMBER || port > AvailablePortFinder.MAX_PORT_NUMBER
);
-        return port;
+        int ldapsPort = AvailablePortFinder.getNextAvailable( ldapPort + 1 );
+        editorBot.setLdapsPort( ldapsPort );
+
+        editorBot.save();
+        editorBot.close();
     }
 
 



Mime
View raw message