directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r1732069 - in /directory/studio/trunk/tests: test.integration.core/src/main/java/org/apache/directory/studio/test/integration/core/Constants.java test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/Constants.java
Date Wed, 24 Feb 2016 10:50:55 GMT
Author: seelmann
Date: Wed Feb 24 10:50:55 2016
New Revision: 1732069

URL: http://svn.apache.org/viewvc?rev=1732069&view=rev
Log:
Use loopback address to avoid DNS lookup

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

Modified: directory/studio/trunk/tests/test.integration.core/src/main/java/org/apache/directory/studio/test/integration/core/Constants.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/tests/test.integration.core/src/main/java/org/apache/directory/studio/test/integration/core/Constants.java?rev=1732069&r1=1732068&r2=1732069&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.core/src/main/java/org/apache/directory/studio/test/integration/core/Constants.java
(original)
+++ directory/studio/trunk/tests/test.integration.core/src/main/java/org/apache/directory/studio/test/integration/core/Constants.java
Wed Feb 24 10:50:55 2016
@@ -20,25 +20,11 @@
 package org.apache.directory.studio.test.integration.core;
 
 
-import java.net.InetAddress;
-import java.net.UnknownHostException;
+import org.apache.directory.api.util.Network;
 
 
 public final class Constants
 {
-    public static final String LOCALHOST = getLocalHost();
-
-
-    private static String getLocalHost()
-    {
-        try
-        {
-            return InetAddress.getLocalHost().getHostName();
-        }
-        catch ( UnknownHostException e )
-        {
-            return "localhost";
-        }
-    }
+    public static final String LOCALHOST = Network.LOOPBACK_HOSTNAME;
 
 }

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/Constants.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/Constants.java?rev=1732069&r1=1732068&r2=1732069&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/Constants.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/Constants.java
Wed Feb 24 10:50:55 2016
@@ -20,40 +20,13 @@
 package org.apache.directory.studio.test.integration.ui;
 
 
-import java.net.InetAddress;
-import java.net.UnknownHostException;
+import org.apache.directory.api.util.Network;
 
 
 public final class Constants
 {
-    public static final String LOCALHOST = getLocalHost();
+    public static final String LOCALHOST = Network.LOOPBACK_HOSTNAME;
 
-
-    private static String getLocalHost()
-    {
-        try
-        {
-            return InetAddress.getLocalHost().getHostName();
-        }
-        catch ( UnknownHostException e )
-        {
-            return "localhost";
-        }
-    }
-
-    public static final String LOCALHOST_ADDRESS = getLocalHostAddress();
-
-
-    private static String getLocalHostAddress()
-    {
-        try
-        {
-            return InetAddress.getLocalHost().getHostAddress();
-        }
-        catch ( UnknownHostException e )
-        {
-            return "localhost";
-        }
-    }
+    public static final String LOCALHOST_ADDRESS = Network.LOOPBACK.getHostAddress();
 
 }



Mime
View raw message