directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r1749205 - in /directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui: ApacheDSPluginTest.java CertificateValidationTest.java bots/ApacheDSConfigurationEditorBot.java
Date Sun, 19 Jun 2016 20:28:45 GMT
Author: seelmann
Date: Sun Jun 19 20:28:45 2016
New Revision: 1749205

URL: http://svn.apache.org/viewvc?rev=1749205&view=rev
Log:
Move code to find available ports

Modified:
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ApacheDSPluginTest.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/CertificateValidationTest.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ApacheDSConfigurationEditorBot.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=1749205&r1=1749204&r2=1749205&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 Jun 19 20:28:45 2016
@@ -43,7 +43,6 @@ import org.apache.directory.studio.test.
 import org.apache.directory.studio.test.integration.ui.bots.NewApacheDSServerWizardBot;
 import org.apache.directory.studio.test.integration.ui.bots.StudioBot;
 import org.apache.directory.studio.test.integration.ui.bots.utils.FrameworkRunnerWithScreenshotCaptureListener;
-import org.apache.mina.util.AvailablePortFinder;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -247,11 +246,7 @@ public class ApacheDSPluginTest
     {
         ApacheDSConfigurationEditorBot editorBot = serversViewBot.openConfigurationEditor(
serverName );
 
-        int ldapPort = AvailablePortFinder.getNextAvailable( 1024 );
-        editorBot.setLdapPort( ldapPort );
-
-        int ldapsPort = AvailablePortFinder.getNextAvailable( ldapPort + 1 );
-        editorBot.setLdapsPort( ldapsPort );
+        editorBot.setAvailableLdapAndLdapsPort();
 
         editorBot.save();
         editorBot.close();
@@ -353,10 +348,9 @@ public class ApacheDSPluginTest
         int oldLdapsPort = remoteEditorBot.getLdapsPort();
 
         // Set new ports
-        int newLdapPort = AvailablePortFinder.getNextAvailable( 1024 );
-        remoteEditorBot.setLdapPort( newLdapPort );
-        int newLdapsPort = AvailablePortFinder.getNextAvailable( newLdapPort + 1 );
-        remoteEditorBot.setLdapsPort( newLdapsPort );
+        remoteEditorBot.setAvailableLdapAndLdapsPort();
+        int newLdapPort = remoteEditorBot.getLdapPort();
+        int newLdapsPort = remoteEditorBot.getLdapsPort();
 
         // Save the config editor
         remoteEditorBot.save();

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/CertificateValidationTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/CertificateValidationTest.java?rev=1749205&r1=1749204&r2=1749205&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/CertificateValidationTest.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/CertificateValidationTest.java
Sun Jun 19 20:28:45 2016
@@ -45,7 +45,6 @@ import org.apache.directory.studio.test.
 import org.apache.directory.studio.test.integration.ui.bots.PreferencesBot;
 import org.apache.directory.studio.test.integration.ui.bots.StudioBot;
 import org.apache.directory.studio.test.integration.ui.bots.utils.FrameworkRunnerWithScreenshotCaptureListener;
-import org.apache.mina.util.AvailablePortFinder;
 import org.junit.After;
 import org.junit.AfterClass;
 import org.junit.Before;
@@ -777,11 +776,9 @@ public class CertificateValidationTest
     {
         ApacheDSConfigurationEditorBot editorBot = serversViewBot.openConfigurationEditor(
serverName );
 
-        ldapPort = AvailablePortFinder.getNextAvailable( 1024 );
-        editorBot.setLdapPort( ldapPort );
-
-        ldapsPort = AvailablePortFinder.getNextAvailable( ldapPort + 1 );
-        editorBot.setLdapsPort( ldapsPort );
+        editorBot.setAvailableLdapAndLdapsPort();
+        ldapPort = editorBot.getLdapPort();
+        ldapsPort = editorBot.getLdapsPort();
 
         editorBot.save();
         editorBot.close();

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ApacheDSConfigurationEditorBot.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ApacheDSConfigurationEditorBot.java?rev=1749205&r1=1749204&r2=1749205&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ApacheDSConfigurationEditorBot.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ApacheDSConfigurationEditorBot.java
Sun Jun 19 20:28:45 2016
@@ -20,6 +20,7 @@
 package org.apache.directory.studio.test.integration.ui.bots;
 
 
+import org.apache.mina.util.AvailablePortFinder;
 import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
 import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotMultiPageEditor;
 import org.eclipse.swtbot.swt.finder.waits.DefaultCondition;
@@ -54,6 +55,15 @@ public class ApacheDSConfigurationEditor
     }
 
 
+    public void setAvailableLdapAndLdapsPort()
+    {
+        int ldapPort = AvailablePortFinder.getNextAvailable( 1024 );
+        setLdapPort( ldapPort );
+        int ldapsPort = AvailablePortFinder.getNextAvailable( getLdapPort() + 1 );
+        setLdapsPort( ldapsPort );
+    }
+
+
     public void setLdapPort( int port )
     {
         editor.activatePage( "LDAP/LDAPS Servers" );



Mime
View raw message