From 0de6858e9548e84aebc148747be92a811ba33636 Mon Sep 17 00:00:00 2001
From: vharseko <vharseko@3a-systems.ru>
Date: Wed, 12 Jul 2023 16:41:15 +0000
Subject: [PATCH] Restore IT test for server-legacy and fix many errors (#279)

---
 opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/LDAPv2TestCase.java |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/LDAPv2TestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/LDAPv2TestCase.java
index d5e3f3a..d88abb7 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/LDAPv2TestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/LDAPv2TestCase.java
@@ -82,7 +82,7 @@
       "replace: ds-cfg-allow-ldap-v2",
       "ds-cfg-allow-ldap-v2: false");
 
-    try (RemoteConnection conn = new RemoteConnection("localhost", TestCaseUtils.getServerLdapPort()))
+    try (RemoteConnection conn = new RemoteConnection("127.0.0.1", TestCaseUtils.getServerLdapPort()))
     {
       bindLdapV2(conn, "cn=Directory Manager", "password", LDAPResultCode.PROTOCOL_ERROR);
     }
@@ -107,7 +107,7 @@
   @Test(expectedExceptions = EOFException.class)
   public void testRejectExtendedRequest() throws Exception
   {
-    try (RemoteConnection conn = new RemoteConnection("localhost", TestCaseUtils.getServerLdapPort()))
+    try (RemoteConnection conn = new RemoteConnection("127.0.0.1", TestCaseUtils.getServerLdapPort()))
     {
       bindLdapV2(conn, "cn=Directory Manager", "password");
       conn.writeMessage(new ExtendedRequestProtocolOp(OID_START_TLS_REQUEST));
@@ -127,7 +127,7 @@
   public void testRejectAddControls()
          throws Exception
   {
-    try (RemoteConnection conn = new RemoteConnection("localhost", TestCaseUtils.getServerLdapPort()))
+    try (RemoteConnection conn = new RemoteConnection("127.0.0.1", TestCaseUtils.getServerLdapPort()))
     {
       bindLdapV2(conn, "cn=Directory Manager", "password");
 
@@ -168,7 +168,7 @@
   public void testRejectBindControls()
          throws Exception
   {
-    try (RemoteConnection conn = new RemoteConnection("localhost", TestCaseUtils.getServerLdapPort()))
+    try (RemoteConnection conn = new RemoteConnection("127.0.0.1", TestCaseUtils.getServerLdapPort()))
     {
       bindLdapV2(conn, "cn=Directory Manager", "password",
           LDAPResultCode.PROTOCOL_ERROR, new LDAPControl(OID_MANAGE_DSAIT_CONTROL, true));
@@ -185,7 +185,7 @@
   public void testRejectCompareControls()
          throws Exception
   {
-    try (RemoteConnection conn = new RemoteConnection("localhost", TestCaseUtils.getServerLdapPort()))
+    try (RemoteConnection conn = new RemoteConnection("127.0.0.1", TestCaseUtils.getServerLdapPort()))
     {
       bindLdapV2(conn, "cn=Directory Manager", "password");
 
@@ -209,7 +209,7 @@
   public void testRejectDeleteControls()
          throws Exception
   {
-    try (RemoteConnection conn = new RemoteConnection("localhost", TestCaseUtils.getServerLdapPort()))
+    try (RemoteConnection conn = new RemoteConnection("127.0.0.1", TestCaseUtils.getServerLdapPort()))
     {
       bindLdapV2(conn, "cn=Directory Manager", "password");
 
@@ -233,7 +233,7 @@
   public void testRejectModifyControls()
          throws Exception
   {
-    try (RemoteConnection conn = new RemoteConnection("localhost", TestCaseUtils.getServerLdapPort()))
+    try (RemoteConnection conn = new RemoteConnection("127.0.0.1", TestCaseUtils.getServerLdapPort()))
     {
       bindLdapV2(conn, "cn=Directory Manager", "password");
 
@@ -258,7 +258,7 @@
   public void testRejectModifyDNControls()
          throws Exception
   {
-    try (RemoteConnection conn = new RemoteConnection("localhost", TestCaseUtils.getServerLdapPort()))
+    try (RemoteConnection conn = new RemoteConnection("127.0.0.1", TestCaseUtils.getServerLdapPort()))
     {
       bindLdapV2(conn, "cn=Directory Manager", "password");
 
@@ -282,7 +282,7 @@
   public void testRejectSearchControls()
          throws Exception
   {
-    try (RemoteConnection conn = new RemoteConnection("localhost", TestCaseUtils.getServerLdapPort()))
+    try (RemoteConnection conn = new RemoteConnection("127.0.0.1", TestCaseUtils.getServerLdapPort()))
     {
       bindLdapV2(conn, "cn=Directory Manager", "password");
 

--
Gitblit v1.10.0