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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to