You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by se...@apache.org on 2021/04/12 04:14:52 UTC

[directory-studio] branch DIRSTUDIO-1274-rework-integration-tests updated: Fix hostname

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

seelmann pushed a commit to branch DIRSTUDIO-1274-rework-integration-tests
in repository https://gitbox.apache.org/repos/asf/directory-studio.git


The following commit(s) were added to refs/heads/DIRSTUDIO-1274-rework-integration-tests by this push:
     new 8cd41c3  Fix hostname
8cd41c3 is described below

commit 8cd41c39483e011079b13bbcb658f09048b889f9
Author: Stefan Seelmann <ma...@stefan-seelmann.de>
AuthorDate: Mon Apr 12 06:14:38 2021 +0200

    Fix hostname
---
 .../core/DirectoryApiConnectionWrapperTest.java    | 38 ++++++++++++----------
 .../integration/junit5/ApacheDirectoryServer.java  |  2 +-
 2 files changed, 22 insertions(+), 18 deletions(-)

diff --git a/tests/test.integration.core/src/main/java/org/apache/directory/studio/test/integration/core/DirectoryApiConnectionWrapperTest.java b/tests/test.integration.core/src/main/java/org/apache/directory/studio/test/integration/core/DirectoryApiConnectionWrapperTest.java
index 5a9ee4a..2ab8933 100644
--- a/tests/test.integration.core/src/main/java/org/apache/directory/studio/test/integration/core/DirectoryApiConnectionWrapperTest.java
+++ b/tests/test.integration.core/src/main/java/org/apache/directory/studio/test/integration/core/DirectoryApiConnectionWrapperTest.java
@@ -21,7 +21,6 @@
 package org.apache.directory.studio.test.integration.core;
 
 
-import static org.apache.directory.studio.test.integration.junit5.Constants.LOCALHOST;
 import static org.apache.directory.studio.test.integration.junit5.TestFixture.CONTEXT_DN;
 import static org.apache.directory.studio.test.integration.junit5.TestFixture.REFERRALS_OU_DN;
 import static org.apache.directory.studio.test.integration.junit5.TestFixture.USERS_OU_DN;
@@ -147,8 +146,9 @@ public class DirectoryApiConnectionWrapperTest
     public void testConnect( TestLdapServer ldapServer )
     {
         StudioProgressMonitor monitor = getProgressMonitor();
-        ConnectionParameter connectionParameter = new ConnectionParameter( null, LOCALHOST, ldapServer.getPort(),
-            EncryptionMethod.NONE, AuthenticationMethod.NONE, null, null, null, true, null, 30000L );
+        ConnectionParameter connectionParameter = new ConnectionParameter( null, ldapServer.getHost(),
+            ldapServer.getPort(), EncryptionMethod.NONE, AuthenticationMethod.NONE, null, null, null, true, null,
+            30000L );
         Connection connection = new Connection( connectionParameter );
         ConnectionWrapper connectionWrapper = connection.getConnectionWrapper();
 
@@ -179,8 +179,9 @@ public class DirectoryApiConnectionWrapperTest
 
         // invalid port
         monitor = getProgressMonitor();
-        connectionParameter = new ConnectionParameter( null, LOCALHOST, AvailablePortFinder.getNextAvailable(),
-            EncryptionMethod.NONE, AuthenticationMethod.NONE, null, null, null, true, null, 30000L );
+        connectionParameter = new ConnectionParameter( null, ldapServer.getHost(),
+            AvailablePortFinder.getNextAvailable(), EncryptionMethod.NONE, AuthenticationMethod.NONE, null, null, null,
+            true, null, 30000L );
         connection = new Connection( connectionParameter );
         connectionWrapper = connection.getConnectionWrapper();
         connectionWrapper.connect( monitor );
@@ -219,9 +220,9 @@ public class DirectoryApiConnectionWrapperTest
     public void testBind( TestLdapServer ldapServer )
     {
         StudioProgressMonitor monitor = getProgressMonitor();
-        ConnectionParameter connectionParameter = new ConnectionParameter( null, LOCALHOST, ldapServer.getPort(),
-            EncryptionMethod.NONE, AuthenticationMethod.SIMPLE, ldapServer.getAdminDn(), ldapServer.getAdminPassword(),
-            null, true, null, 30000L );
+        ConnectionParameter connectionParameter = new ConnectionParameter( null, ldapServer.getHost(),
+            ldapServer.getPort(), EncryptionMethod.NONE, AuthenticationMethod.SIMPLE, ldapServer.getAdminDn(),
+            ldapServer.getAdminPassword(), null, true, null, 30000L );
         Connection connection = new Connection( connectionParameter );
         ConnectionWrapper connectionWrapper = connection.getConnectionWrapper();
 
@@ -252,8 +253,9 @@ public class DirectoryApiConnectionWrapperTest
 
         // simple auth with invalid user
         monitor = getProgressMonitor();
-        connectionParameter = new ConnectionParameter( null, LOCALHOST, ldapServer.getPort(), EncryptionMethod.NONE,
-            AuthenticationMethod.SIMPLE, "cn=invalid," + USERS_OU_DN, "invalid", null, true, null, 30000L );
+        connectionParameter = new ConnectionParameter( null, ldapServer.getHost(), ldapServer.getPort(),
+            EncryptionMethod.NONE, AuthenticationMethod.SIMPLE, "cn=invalid," + USERS_OU_DN, "invalid", null, true,
+            null, 30000L );
         connection = new Connection( connectionParameter );
         connectionWrapper = connection.getConnectionWrapper();
         connectionWrapper.connect( monitor );
@@ -271,8 +273,9 @@ public class DirectoryApiConnectionWrapperTest
 
         // simple auth with invalid password
         monitor = getProgressMonitor();
-        connectionParameter = new ConnectionParameter( null, LOCALHOST, ldapServer.getPort(), EncryptionMethod.NONE,
-            AuthenticationMethod.SIMPLE, ldapServer.getAdminDn(), "invalid", null, true, null, 30000L );
+        connectionParameter = new ConnectionParameter( null, ldapServer.getHost(), ldapServer.getPort(),
+            EncryptionMethod.NONE, AuthenticationMethod.SIMPLE, ldapServer.getAdminDn(), "invalid", null, true, null,
+            30000L );
         connection = new Connection( connectionParameter );
         connectionWrapper = connection.getConnectionWrapper();
         connectionWrapper.connect( monitor );
@@ -1055,8 +1058,9 @@ public class DirectoryApiConnectionWrapperTest
         String dn, String password )
     {
         // simple auth without principal and credential
-        ConnectionParameter connectionParameter = new ConnectionParameter( null, LOCALHOST, ldapServer.getPort(),
-            EncryptionMethod.NONE, AuthenticationMethod.SIMPLE, dn, password, null, false, null, 30000L );
+        ConnectionParameter connectionParameter = new ConnectionParameter( null, ldapServer.getHost(),
+            ldapServer.getPort(), EncryptionMethod.NONE, AuthenticationMethod.SIMPLE, dn, password, null, false, null,
+            30000L );
 
         Connection connection = new Connection( connectionParameter );
 
@@ -1081,9 +1085,9 @@ public class DirectoryApiConnectionWrapperTest
     protected ConnectionWrapper getConnectionWrapper( StudioProgressMonitor monitor, TestLdapServer ldapServer )
     {
         // simple auth without principal and credential
-        ConnectionParameter connectionParameter = new ConnectionParameter( null, LOCALHOST, ldapServer.getPort(),
-            EncryptionMethod.NONE, AuthenticationMethod.SIMPLE, ldapServer.getAdminDn(), ldapServer.getAdminPassword(),
-            null, false, null, 30000L );
+        ConnectionParameter connectionParameter = new ConnectionParameter( null, ldapServer.getHost(),
+            ldapServer.getPort(), EncryptionMethod.NONE, AuthenticationMethod.SIMPLE, ldapServer.getAdminDn(),
+            ldapServer.getAdminPassword(), null, false, null, 30000L );
 
         Connection connection = new Connection( connectionParameter );
 
diff --git a/tests/test.integration.core/src/main/java/org/apache/directory/studio/test/integration/junit5/ApacheDirectoryServer.java b/tests/test.integration.core/src/main/java/org/apache/directory/studio/test/integration/junit5/ApacheDirectoryServer.java
index d47e044..7873caf 100644
--- a/tests/test.integration.core/src/main/java/org/apache/directory/studio/test/integration/junit5/ApacheDirectoryServer.java
+++ b/tests/test.integration.core/src/main/java/org/apache/directory/studio/test/integration/junit5/ApacheDirectoryServer.java
@@ -39,7 +39,7 @@ import org.apache.mina.util.AvailablePortFinder;
 /**
  * An ApacheDS implementation of a test LDAP server.
  * 
- * This implementation starts an embedded LdapServer and adds a partition dc=example,dc=org.
+ * This implementation starts an embedded ApacheDS and adds a partition dc=example,dc=org.
  */
 public class ApacheDirectoryServer extends TestLdapServer
 {