diff --git a/tests/unit/src/com/unboundid/ldap/listener/InMemoryDirectoryServerTestCase.java b/tests/unit/src/com/unboundid/ldap/listener/InMemoryDirectoryServerTestCase.java index 3500b6f51..81c5a8079 100644 --- a/tests/unit/src/com/unboundid/ldap/listener/InMemoryDirectoryServerTestCase.java +++ b/tests/unit/src/com/unboundid/ldap/listener/InMemoryDirectoryServerTestCase.java @@ -6610,19 +6610,19 @@ public void testMaxConnections() } catch (final LDAPException e) { - assertEquals(unHandler.getNotificationCount(), 2); + // This was expected. } - - - // Closed all the remaining connections. - for (final LDAPConnection c : connList) + finally { - c.close(); - } - connList.clear(); - + // Closed all the remaining connections. + for (final LDAPConnection c : connList) + { + c.close(); + } + connList.clear(); - ds.shutDown(true); + ds.shutDown(true); + } } diff --git a/tests/unit/src/com/unboundid/ldap/sdk/LDAPConnectionOptionsTestCase.java b/tests/unit/src/com/unboundid/ldap/sdk/LDAPConnectionOptionsTestCase.java index 1a6b9b3d5..b3ee2f2ce 100644 --- a/tests/unit/src/com/unboundid/ldap/sdk/LDAPConnectionOptionsTestCase.java +++ b/tests/unit/src/com/unboundid/ldap/sdk/LDAPConnectionOptionsTestCase.java @@ -1141,10 +1141,10 @@ public void testSSLSocketVerifiers() cfg.setListenerConfigs( InMemoryListenerConfig.createLDAPConfig("LDAP", - InetAddress.getLocalHost(), 0, + InetAddress.getByName("127.0.0.1"), 0, serverSSLUtil.createSSLSocketFactory()), InMemoryListenerConfig.createLDAPSConfig("LDAPS", - InetAddress.getLocalHost(), 0, + InetAddress.getByName("127.0.0.1"), 0, serverSSLUtil.createSSLServerSocketFactory(), clientSSLUtil.createSSLSocketFactory())); @@ -1158,8 +1158,7 @@ public void testSSLSocketVerifiers() opts.getSSLSocketVerifier() instanceof TrustAllSSLSocketVerifier); LDAPConnection conn = new LDAPConnection( - clientSSLUtil.createSSLSocketFactory(), opts, - ds.getListenAddress("LDAPS").getHostAddress(), + clientSSLUtil.createSSLSocketFactory(), opts, "127.0.0.1", ds.getListenPort("LDAPS")); assertNotNull(conn.getRootDSE()); assertTrue(TrustAllSSLSocketVerifier.getInstance().verify("127.0.0.1", @@ -1168,9 +1167,7 @@ public void testSSLSocketVerifiers() "disallowed.example.com", conn.getSSLSession())); conn.close(); - conn = new LDAPConnection(opts, - ds.getListenAddress("LDAP").getHostAddress(), - ds.getListenPort("LDAP")); + conn = new LDAPConnection(opts, "127.0.0.1", ds.getListenPort("LDAP")); assertNotNull(conn.getRootDSE()); assertResultCodeEquals(conn, new StartTLSExtendedRequest(clientSSLUtil.createSSLSocketFactory()), @@ -1226,8 +1223,7 @@ public void testSSLSocketVerifiers() conn = new LDAPConnection(clientSSLUtil.createSSLSocketFactory(), opts, - ds.getListenAddress("LDAPS").getHostAddress(), - ds.getListenPort("LDAPS")); + "127.0.0.1", ds.getListenPort("LDAPS")); assertNotNull(conn.getRootDSE()); assertTrue(new HostNameSSLSocketVerifier(true).verify("127.0.0.1", conn.getSSLSession())); @@ -1235,9 +1231,7 @@ public void testSSLSocketVerifiers() "disallowed.example.com", conn.getSSLSession())); conn.close(); - conn = new LDAPConnection(opts, - ds.getListenAddress("LDAP").getHostAddress(), - ds.getListenPort("LDAP")); + conn = new LDAPConnection(opts, "127.0.0.1", ds.getListenPort("LDAP")); assertNotNull(conn.getRootDSE()); assertResultCodeEquals(conn, new StartTLSExtendedRequest(clientSSLUtil.createSSLSocketFactory()),