Imported Upstream version 4.2.0.179

Former-commit-id: 0a113cb3a6feb7873f632839b1307cc6033cd595
This commit is contained in:
Xamarin Public Jenkins
2015-08-26 07:17:56 -04:00
committed by Jo Shields
parent 183bba2c9a
commit 6992685b86
7507 changed files with 90259 additions and 657307 deletions

View File

@@ -34,6 +34,8 @@ using System.ServiceModel.Description;
using System.ServiceModel.Dispatcher;
using NUnit.Framework;
using MonoTests.Helpers;
namespace MonoTests.System.ServiceModel
{
[TestFixture]
@@ -172,10 +174,11 @@ namespace MonoTests.System.ServiceModel
[Test]
public void AddServiceEndpoint2_4 ()
{
ServiceHost host = new ServiceHost (typeof (HogeFuga), new Uri ("http://localhost:37564"));
var ep = "http://" + NetworkHelpers.LocalEphemeralEndPoint().ToString();
ServiceHost host = new ServiceHost (typeof (HogeFuga), new Uri (ep));
var binding = new BasicHttpBinding ();
host.AddServiceEndpoint (typeof (IHoge), binding, new Uri ("http://localhost:37564"));
host.AddServiceEndpoint (typeof (IFuga), binding, new Uri ("http://localhost:37564"));
host.AddServiceEndpoint (typeof (IHoge), binding, new Uri (ep));
host.AddServiceEndpoint (typeof (IFuga), binding, new Uri (ep));
// Use the same binding, results in one ChannelDispatcher (actually two, for metadata/debug behavior).
host.Open ();
@@ -296,13 +299,14 @@ namespace MonoTests.System.ServiceModel
[Test]
public void InstanceWithNonSingletonMode ()
{
var ep = NetworkHelpers.LocalEphemeralEndPoint().ToString();
ServiceHost host = new ServiceHost (
new NonSingletonService ());
Assert.IsNotNull (host.Description.Behaviors.Find<ServiceBehaviorAttribute> ().GetWellKnownSingleton (), "premise1");
host.AddServiceEndpoint (
typeof (NonSingletonService),
new BasicHttpBinding (),
new Uri ("http://localhost:37564/s1"));
new Uri ("http://" + ep + "/s1"));
// in case Open() didn't fail, we need to close the host.
// And even if Close() caused the expected exception,
@@ -323,13 +327,14 @@ namespace MonoTests.System.ServiceModel
[Test]
public void InstanceWithSingletonMode ()
{
var ep = NetworkHelpers.LocalEphemeralEndPoint().ToString();
SingletonService instance = new SingletonService ();
ServiceHost host = new ServiceHost (instance);
Assert.IsNotNull (host.Description.Behaviors.Find<ServiceBehaviorAttribute> ().GetWellKnownSingleton (), "#1");
host.AddServiceEndpoint (
typeof (SingletonService),
new BasicHttpBinding (),
new Uri ("http://localhost:37564/s2"));
new Uri ("http://" + ep + "/s2"));
// in case Open() didn't fail, we need to close the host.
// And even if Close() caused the expected exception,