commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1557477 - /commons/proper/net/trunk/src/test/java/org/apache/commons/net/time/TimeTCPClientTest.java
Date Sun, 12 Jan 2014 01:13:02 GMT
Author: sebb
Date: Sun Jan 12 01:13:01 2014
New Revision: 1557477

URL: http://svn.apache.org/r1557477
Log:
A bit more debug

Modified:
    commons/proper/net/trunk/src/test/java/org/apache/commons/net/time/TimeTCPClientTest.java

Modified: commons/proper/net/trunk/src/test/java/org/apache/commons/net/time/TimeTCPClientTest.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/test/java/org/apache/commons/net/time/TimeTCPClientTest.java?rev=1557477&r1=1557476&r2=1557477&view=diff
==============================================================================
--- commons/proper/net/trunk/src/test/java/org/apache/commons/net/time/TimeTCPClientTest.java
(original)
+++ commons/proper/net/trunk/src/test/java/org/apache/commons/net/time/TimeTCPClientTest.java
Sun Jan 12 01:13:01 2014
@@ -74,12 +74,13 @@ public class TimeTCPClientTest extends T
         try
         {
             TimeTCPClient client = new TimeTCPClient();
+            InetAddress localHost = InetAddress.getLocalHost();
             try
             {
                 // We want to timeout if a response takes longer than 60 seconds
                 client.setDefaultTimeout(60000);
-                System.out.println("Attempt to connect to server on " + _port);
-                client.connect(InetAddress.getLocalHost(), _port);
+                System.out.println("Attempt to connect to server on " + localHost + " " +
_port);
+                client.connect(localHost, _port);
                 clientTime = client.getDate().getTime();
                 time = System.currentTimeMillis();
             } finally
@@ -94,7 +95,7 @@ public class TimeTCPClientTest extends T
                 // We want to timeout if a response takes longer than 60 seconds
                 client.setDefaultTimeout(60000);
                 System.out.println("Attempt to connect to server on " + _port);
-                client.connect(InetAddress.getLocalHost(), _port);
+                client.connect(localHost, _port);
                 clientTime2 = (client.getTime() - TimeTCPClient.SECONDS_1900_TO_1970)*1000L;
                 time2 = System.currentTimeMillis();
             } finally



Mime
View raw message