// (C) 2001 Mads Pultz\r
// (C) 2003 Martin Willemoes Hansen\r
// \r
-// This test assumes the following:\r
-// 1) The following Internet sites exist:\r
-// www.go-mono.com with IP address 64.14.94.188\r
-// info.diku.dk with IP address 130.225.96.4\r
-// 2) The following DNS name does not exist:\r
-// www.hopefullydoesnotexist.dk\r
-//\r
\r
using System;\r
using System.Collections;\r
[TestFixture]\r
public class DnsTest\r
{\r
- private String site1Name = "mono-project.com",\r
- site1Dot = "96.126.105.110",\r
- site2Name = "info.diku.dk",\r
- site2Dot = "130.225.96.4",\r
- noneExistingSite = "www.unlikely.novell.com";\r
- private uint site1IP = 1852407392, site2IP = 2195808260; // Big-Endian\r
+ private String site1Name = "google-public-dns-a.google.com",\r
+ site1Dot = "8.8.8.8",\r
+ site2Name = "google-public-dns-b.google.com",\r
+ site2Dot = "8.8.4.4",\r
+ noneExistingSite = "unlikely.xamarin.com";\r
+ private uint site1IP = 134744072, site2IP = 134743044; // Big-Endian\r
\r
[Test]\r
public void AsyncGetHostByName ()\r
IAsyncResult async = Dns.BeginGetHostByName (site1Name, null, null);\r
IPHostEntry entry = Dns.EndGetHostByName (async);\r
SubTestValidIPHostEntry (entry);\r
- Assert.IsTrue (entry.HostName == "www.mono-project.com" || entry.HostName == "mono-project.com");\r
+ Assert.IsTrue (entry.HostName == "google-public-dns-a.google.com");\r
}\r
\r
void GetHostByNameCallback (IAsyncResult ar)\r
SubTestValidIPHostEntry (h);\r
}\r
\r
-#if NET_2_0\r
[Test]\r
public void BeginGetHostAddresses_HostNameOrAddress_Null ()\r
{\r
Assert.AreEqual ("hostNameOrAddress", ex.ParamName, "#B5");\r
}\r
}\r
-#endif\r
\r
[Test]\r
public void GetHostName ()\r
[Test]\r
public void GetHostByName ()\r
{\r
- SubTestGetHostByName ("www.mono-project.com", site1Dot);\r
+ SubTestGetHostByName (site1Name, site1Dot);\r
SubTestGetHostByName (site2Name, site2Dot);\r
try {\r
var entry = Dns.GetHostByName (noneExistingSite);\r
\r
[Test]\r
[ExpectedException (typeof (SocketException))]\r
-#if TARGET_JVM\r
- [Ignore ("Ignore failures in Sys.Net")]\r
-#endif\r
public void GetHostByAddressString2 ()\r
{\r
Dns.GetHostByAddress ("123.255.23");\r