X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem.ServiceModel.Web%2FTest%2FSystem.ServiceModel.Web%2FWebServiceHostTest.cs;h=8f0cd0e14e28e5f90462acd83306d44d44497bb8;hb=05a1144d4d52389790c856a6ab676764925f68f7;hp=2c7509da96cd4aa4b0f5cb860c3a1da5389aeba4;hpb=9c3cdff186534d968fef911130bd86fcba11665a;p=mono.git diff --git a/mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Web/WebServiceHostTest.cs b/mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Web/WebServiceHostTest.cs index 2c7509da96c..8f0cd0e14e2 100644 --- a/mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Web/WebServiceHostTest.cs +++ b/mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Web/WebServiceHostTest.cs @@ -37,6 +37,8 @@ using System.ServiceModel.Description; using System.ServiceModel.Dispatcher; using System.Net; +using MonoTests.Helpers; + namespace MonoTests.System.ServiceModel.Web { [TestFixture] @@ -46,7 +48,7 @@ namespace MonoTests.System.ServiceModel.Web [Category("NotWorking")] public void ServiceDebugBehaviorTest () { - var host = new WebServiceHost (typeof (MyService), new Uri ("http://localhost:30158/")); + var host = new WebServiceHost (typeof (MyService), new Uri ("http://" + NetworkHelpers.LocalEphemeralEndPoint().ToString())); ServiceEndpoint webHttp = host.AddServiceEndpoint ("MonoTests.System.ServiceModel.Web.WebServiceHostTest+MyService", new WebHttpBinding (), "WebHttpBinding"); Assert.AreEqual (true, host.Description.Behaviors.Find ().HttpHelpPageEnabled, "HttpHelpPageEnabled #1"); @@ -64,7 +66,7 @@ namespace MonoTests.System.ServiceModel.Web [Category ("NotWorking")] public void WebHttpBehaviorTest1 () { - var host = new WebServiceHost (typeof (MyService), new Uri ("http://localhost:30158/")); + var host = new WebServiceHost (typeof (MyService), new Uri ("http://" + NetworkHelpers.LocalEphemeralEndPoint().ToString())); ServiceEndpoint webHttp = host.AddServiceEndpoint ("MonoTests.System.ServiceModel.Web.WebServiceHostTest+MyService", new WebHttpBinding (), "WebHttpBinding"); ServiceEndpoint basicHttp = host.AddServiceEndpoint ("MonoTests.System.ServiceModel.Web.WebServiceHostTest+MyService", new BasicHttpBinding (), "BasicHttpBinding"); @@ -84,7 +86,7 @@ namespace MonoTests.System.ServiceModel.Web [Category("NotWorking")] public void WebHttpBehaviorTest2 () { - var host = new WebServiceHost (typeof (MyService), new Uri ("http://localhost:30158/")); + var host = new WebServiceHost (typeof (MyService), new Uri ("http://" + NetworkHelpers.LocalEphemeralEndPoint().ToString())); ServiceEndpoint webHttp = host.AddServiceEndpoint ("MonoTests.System.ServiceModel.Web.WebServiceHostTest+MyService", new WebHttpBinding (), "WebHttpBinding"); MyWebHttpBehavior behavior = new MyWebHttpBehavior (); behavior.ApplyDispatchBehaviorBegin += delegate { @@ -104,7 +106,7 @@ namespace MonoTests.System.ServiceModel.Web [Test] public void ServiceBaseUriTest () { - var host = new WebServiceHost (typeof (MyService), new Uri ("http://localhost:30158/")); + var host = new WebServiceHost (typeof (MyService), new Uri ("http://" + NetworkHelpers.LocalEphemeralEndPoint().ToString())); Assert.AreEqual (0, host.Description.Endpoints.Count, "no endpoints yet"); host.Open (); Assert.AreEqual (1, host.Description.Endpoints.Count, "default endpoint after open"); @@ -138,12 +140,13 @@ namespace MonoTests.System.ServiceModel.Web [Test] public void Connect () { + var url = "http://" + NetworkHelpers.LocalEphemeralEndPoint().ToString(); var host = new WebServiceHost (typeof (DemoService), new Uri - ("http://localhost:30158/")); + (url)); try { host.Open (); var wc = new WebClient(); - wc.DownloadString("http://localhost:30158/testData"); + wc.DownloadString(url + "/testData"); Console.WriteLine(); } finally { host.Close();