commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t.@apache.org
Subject svn commit: r1586637 - in /commons/proper/jcs/trunk/src: java/org/apache/commons/jcs/utils/net/ test/org/apache/commons/jcs/auxiliary/remote/server/
Date Fri, 11 Apr 2014 12:53:49 GMT
Author: tv
Date: Fri Apr 11 12:53:49 2014
New Revision: 1586637

URL: http://svn.apache.org/r1586637
Log:
Attempt to fix test failures on Continuum

Modified:
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/net/HostNameUtil.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/server/BasicRemoteCacheClientServerUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheServerStartupUtil.java

Modified: commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/net/HostNameUtil.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/net/HostNameUtil.java?rev=1586637&r1=1586636&r2=1586637&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/net/HostNameUtil.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/net/HostNameUtil.java Fri
Apr 11 12:53:49 2014
@@ -87,7 +87,7 @@ public class HostNameUtil
      * @return InetAddress
      * @throws UnknownHostException If the LAN address of the machine cannot be found.
      */
-    private static InetAddress getLocalHostLANAddress()
+    public static InetAddress getLocalHostLANAddress()
         throws UnknownHostException
     {
         try

Modified: commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/server/BasicRemoteCacheClientServerUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/server/BasicRemoteCacheClientServerUnitTest.java?rev=1586637&r1=1586636&r2=1586637&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/server/BasicRemoteCacheClientServerUnitTest.java
(original)
+++ commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/server/BasicRemoteCacheClientServerUnitTest.java
Fri Apr 11 12:53:49 2014
@@ -33,6 +33,7 @@ import org.apache.commons.jcs.engine.Cac
 import org.apache.commons.jcs.engine.behavior.ICacheElement;
 import org.apache.commons.jcs.engine.control.MockCompositeCacheManager;
 import org.apache.commons.jcs.engine.control.MockElementSerializer;
+import org.apache.commons.jcs.utils.net.HostNameUtil;
 import org.apache.commons.jcs.utils.timing.SleepUtil;
 
 /**
@@ -255,7 +256,7 @@ public class BasicRemoteCacheClientServe
     public void testLocalHost() throws Exception {
         final InetAddress byName = InetAddress.getByName("localhost");
         assertTrue("Expected localhost ("+byName.getHostAddress()+") to be a loopback address",
byName.isLoopbackAddress());
-        final InetAddress localHost = InetAddress.getLocalHost();
-        assertTrue("Expected getLocalHost() ("+localHost+") to return a site local address",
localHost.isSiteLocalAddress());
+        final InetAddress localHost = HostNameUtil.getLocalHostLANAddress();
+        assertTrue("Expected getLocalHostLANAddress() ("+localHost+") to return a site local
address", localHost.isSiteLocalAddress());
     }
 }

Modified: commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheServerStartupUtil.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheServerStartupUtil.java?rev=1586637&r1=1586636&r2=1586637&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheServerStartupUtil.java
(original)
+++ commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheServerStartupUtil.java
Fri Apr 11 12:53:49 2014
@@ -21,12 +21,12 @@ package org.apache.commons.jcs.auxiliary
 
 import java.io.IOException;
 import java.io.Serializable;
-import java.net.InetAddress;
 import java.net.UnknownHostException;
 import java.rmi.RemoteException;
 import java.rmi.registry.LocateRegistry;
 import java.util.Properties;
 
+import org.apache.commons.jcs.utils.net.HostNameUtil;
 import org.apache.commons.jcs.utils.props.PropertyLoader;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -86,7 +86,7 @@ public class RemoteCacheServerStartupUti
         String registryHost;
         try
         {
-            registryHost = InetAddress.getLocalHost().getHostAddress();
+            registryHost = HostNameUtil.getLocalHostAddress();
 
             if ( log.isDebugEnabled() )
             {



Mime
View raw message