james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r981741 - /james/server/trunk/domain-api/src/test/java/org/apache/james/api/dnsservice/AbstractDNSServerTest.java
Date Tue, 03 Aug 2010 05:32:58 GMT
Author: norman
Date: Tue Aug  3 05:32:58 2010
New Revision: 981741

URL: http://svn.apache.org/viewvc?rev=981741&view=rev
Log:
Fix test so it work on any OS

Modified:
    james/server/trunk/domain-api/src/test/java/org/apache/james/api/dnsservice/AbstractDNSServerTest.java

Modified: james/server/trunk/domain-api/src/test/java/org/apache/james/api/dnsservice/AbstractDNSServerTest.java
URL: http://svn.apache.org/viewvc/james/server/trunk/domain-api/src/test/java/org/apache/james/api/dnsservice/AbstractDNSServerTest.java?rev=981741&r1=981740&r2=981741&view=diff
==============================================================================
--- james/server/trunk/domain-api/src/test/java/org/apache/james/api/dnsservice/AbstractDNSServerTest.java
(original)
+++ james/server/trunk/domain-api/src/test/java/org/apache/james/api/dnsservice/AbstractDNSServerTest.java
Tue Aug  3 05:32:58 2010
@@ -60,7 +60,14 @@ public class AbstractDNSServerTest exten
      */
     public void testLocalhost() throws UnknownHostException {
         assertEquals("localhost/127.0.0.1", DNS_SERVER.getByName("localhost").toString());
-        assertEquals("127.0.0.1", DNS_SERVER.getHostName(InetAddress.getByName("127.0.0.1")).toString());
+        String localHost = DNS_SERVER.getHostName(InetAddress.getByName("127.0.0.1")).toString();
+        boolean match = false;
+        
+        // it may be possible that it return localhost or 127.0.0.1.
+        // This depends on the OS
+        if (localHost.equals("localhost") || localHost.equals("127.0.0.1")) match = true;
+        
+        assertTrue("Was not localhost and not 127.0.0.1", match);
     }
     
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message