You've already forked linux-packaging-mono
Imported Upstream version 4.2.0.179
Former-commit-id: 0a113cb3a6feb7873f632839b1307cc6033cd595
This commit is contained in:
committed by
Jo Shields
parent
183bba2c9a
commit
6992685b86
@@ -35,6 +35,8 @@ using NUnit.Framework;
|
||||
|
||||
using WebServiceMoonlightTest.ServiceReference1;
|
||||
|
||||
using MonoTests.Helpers;
|
||||
|
||||
namespace MonoTests.System.ServiceModel.Dispatcher
|
||||
{
|
||||
[TestFixture]
|
||||
@@ -44,7 +46,8 @@ namespace MonoTests.System.ServiceModel.Dispatcher
|
||||
public void Bug652331_2 () // test in one of the comment
|
||||
{
|
||||
// Init service
|
||||
ServiceHost serviceHost = new ServiceHost (typeof (Service1), new Uri ("http://localhost:37564/Service1"));
|
||||
int port = NetworkHelpers.FindFreePort ();
|
||||
ServiceHost serviceHost = new ServiceHost (typeof (Service1), new Uri ("http://localhost:" + port + "/Service1"));
|
||||
serviceHost.AddServiceEndpoint (typeof (IService1), new BasicHttpBinding (), string.Empty);
|
||||
|
||||
// Enable metadata exchange (WSDL publishing)
|
||||
@@ -58,7 +61,7 @@ namespace MonoTests.System.ServiceModel.Dispatcher
|
||||
try {
|
||||
// client
|
||||
var binding = new BasicHttpBinding ();
|
||||
var remoteAddress = new EndpointAddress ("http://localhost:37564/Service1");
|
||||
var remoteAddress = new EndpointAddress ("http://localhost:" + port + "/Service1");
|
||||
var client = new Service1Client (binding, remoteAddress);
|
||||
|
||||
var wait = new ManualResetEvent (false);
|
||||
|
@@ -37,6 +37,8 @@ using NUnit.Framework;
|
||||
|
||||
using WebServiceMoonlightTest.ServiceReference2;
|
||||
|
||||
using MonoTests.Helpers;
|
||||
|
||||
namespace MonoTests.System.ServiceModel.Dispatcher
|
||||
{
|
||||
[TestFixture]
|
||||
@@ -47,7 +49,7 @@ namespace MonoTests.System.ServiceModel.Dispatcher
|
||||
public void Bug652331_3 ()
|
||||
{
|
||||
// Init service
|
||||
ServiceHost serviceHost = new ServiceHost(typeof(Service1), new Uri("http://localhost:37564/Service1"));
|
||||
ServiceHost serviceHost = new ServiceHost(typeof(Service1), new Uri("http://localhost:" + NetworkHelpers.FindFreePort () + "/Service1"));
|
||||
serviceHost.AddServiceEndpoint(typeof(IService1), new BasicHttpBinding(), string.Empty);
|
||||
|
||||
// Enable metadata exchange (WSDL publishing)
|
||||
@@ -68,7 +70,7 @@ namespace MonoTests.System.ServiceModel.Dispatcher
|
||||
void RunClient ()
|
||||
{
|
||||
var binding = new BasicHttpBinding ();
|
||||
var remoteAddress = new EndpointAddress ("http://localhost:37564/Service1");
|
||||
var remoteAddress = new EndpointAddress ("http://localhost:" + NetworkHelpers.FindFreePort () + "/Service1");
|
||||
|
||||
var normalClient = new Service1Client (binding, remoteAddress);
|
||||
var collectionClient = new Service1Client (binding, remoteAddress);
|
||||
|
@@ -10,6 +10,8 @@ using System.ServiceModel.Channels;
|
||||
using System.ServiceModel.Description;
|
||||
using System.ServiceModel.Dispatcher;
|
||||
|
||||
using MonoTests.Helpers;
|
||||
|
||||
namespace MonoTests.System.ServiceModel.Dispatcher
|
||||
{
|
||||
[TestFixture]
|
||||
@@ -42,7 +44,7 @@ namespace MonoTests.System.ServiceModel.Dispatcher
|
||||
var st = cd.ServiceThrottle;
|
||||
Assert.IsNull (st, "#0");
|
||||
|
||||
var uri = CreateAvailableUri ("http://localhost:37564");
|
||||
var uri = CreateAvailableUri ("http://localhost:" + NetworkHelpers.FindFreePort ());
|
||||
ServiceHost h = new ServiceHost (typeof (TestContract), uri);
|
||||
h.AddServiceEndpoint (typeof (TestContract).FullName, new BasicHttpBinding (), "address");
|
||||
h.ChannelDispatchers.Add (cd);
|
||||
@@ -69,7 +71,7 @@ namespace MonoTests.System.ServiceModel.Dispatcher
|
||||
[Test]
|
||||
public void Collection_Add_Remove () {
|
||||
Console.WriteLine ("STart test Collection_Add_Remove");
|
||||
var uri = CreateAvailableUri ("http://localhost:37564");
|
||||
var uri = CreateAvailableUri ("http://localhost:" + NetworkHelpers.FindFreePort ());
|
||||
ServiceHost h = new ServiceHost (typeof (TestContract), uri);
|
||||
h.AddServiceEndpoint (typeof (TestContract).FullName, new BasicHttpBinding (), "address");
|
||||
MyChannelDispatcher d = new MyChannelDispatcher (new MyChannelListener (uri));
|
||||
@@ -87,7 +89,7 @@ namespace MonoTests.System.ServiceModel.Dispatcher
|
||||
[Test]
|
||||
public void EndpointDispatcherAddTest ()
|
||||
{
|
||||
var uri = CreateAvailableUri ("http://localhost:37564");
|
||||
var uri = CreateAvailableUri ("http://localhost:" + NetworkHelpers.FindFreePort ());
|
||||
MyChannelDispatcher d = new MyChannelDispatcher (new MyChannelListener (uri));
|
||||
d.Endpoints.Add (new EndpointDispatcher (new EndpointAddress (uri), "", ""));
|
||||
}
|
||||
@@ -95,7 +97,7 @@ namespace MonoTests.System.ServiceModel.Dispatcher
|
||||
[Test]
|
||||
[ExpectedException (typeof (InvalidOperationException))]
|
||||
public void EndpointDispatcherAddTest2 () {
|
||||
var uri = CreateAvailableUri ("http://localhost:37564");
|
||||
var uri = CreateAvailableUri ("http://localhost:" + NetworkHelpers.FindFreePort ());
|
||||
MyChannelDispatcher d = new MyChannelDispatcher (new MyChannelListener (uri));
|
||||
d.Endpoints.Add (new EndpointDispatcher (new EndpointAddress (uri), "", ""));
|
||||
d.Open (); // the dispatcher must be attached.
|
||||
@@ -105,7 +107,7 @@ namespace MonoTests.System.ServiceModel.Dispatcher
|
||||
[ExpectedException (typeof (InvalidOperationException))]
|
||||
public void EndpointDispatcherAddTest3 ()
|
||||
{
|
||||
var uri = CreateAvailableUri ("http://localhost:37564");
|
||||
var uri = CreateAvailableUri ("http://localhost:" + NetworkHelpers.FindFreePort ());
|
||||
ServiceHost h = new ServiceHost (typeof (TestContract), uri);
|
||||
MyChannelDispatcher d = new MyChannelDispatcher (new MyChannelListener (uri));
|
||||
d.Endpoints.Add (new EndpointDispatcher (new EndpointAddress (uri), "", ""));
|
||||
@@ -117,7 +119,7 @@ namespace MonoTests.System.ServiceModel.Dispatcher
|
||||
[ExpectedException (typeof (InvalidOperationException))] // i.e. it is thrown synchronously in current thread.
|
||||
public void EndpointDispatcherAddTest4 ()
|
||||
{
|
||||
var uri = CreateAvailableUri ("http://localhost:37564");
|
||||
var uri = CreateAvailableUri ("http://localhost:" + NetworkHelpers.FindFreePort ());
|
||||
ServiceHost h = new ServiceHost (typeof (TestContract), uri);
|
||||
var listener = new MyChannelListener (uri);
|
||||
MyChannelDispatcher d = new MyChannelDispatcher (listener);
|
||||
@@ -149,7 +151,7 @@ namespace MonoTests.System.ServiceModel.Dispatcher
|
||||
[ExpectedException (typeof (InvalidOperationException))] // i.e. it is thrown synchronously in current thread.
|
||||
public void EndpointDispatcherAddTest5 ()
|
||||
{
|
||||
var uri = CreateAvailableUri ("http://localhost:37564");
|
||||
var uri = CreateAvailableUri ("http://localhost:" + NetworkHelpers.FindFreePort ());
|
||||
ServiceHost h = new ServiceHost (typeof (TestContract), uri);
|
||||
var binding = new BasicHttpBinding ();
|
||||
var listener = new MyChannelListener (uri);
|
||||
@@ -171,7 +173,7 @@ namespace MonoTests.System.ServiceModel.Dispatcher
|
||||
[Test]
|
||||
public void EndpointDispatcherAddTest6 ()
|
||||
{
|
||||
var uri = CreateAvailableUri ("http://localhost:37564");
|
||||
var uri = CreateAvailableUri ("http://localhost:" + NetworkHelpers.FindFreePort ());
|
||||
ServiceHost h = new ServiceHost (typeof (TestContract), uri);
|
||||
var binding = new BasicHttpBinding ();
|
||||
var listener = new MyChannelListener<IReplyChannel> (uri);
|
||||
@@ -202,7 +204,7 @@ namespace MonoTests.System.ServiceModel.Dispatcher
|
||||
[ExpectedException (typeof (InvalidOperationException))]
|
||||
public void EndpointDispatcherAddTest7 ()
|
||||
{
|
||||
var uri = CreateAvailableUri ("http://localhost:37564");
|
||||
var uri = CreateAvailableUri ("http://localhost:" + NetworkHelpers.FindFreePort ());
|
||||
ServiceHost h = new ServiceHost (typeof (TestContract), uri);
|
||||
var binding = new BasicHttpBinding ();
|
||||
var listener = new MyChannelListener<IReplyChannel> (uri);
|
||||
@@ -237,7 +239,7 @@ namespace MonoTests.System.ServiceModel.Dispatcher
|
||||
// but it makes little sense especially for checking duplicate listen URIs. Duplicate listen URIs should be rejected anyways.
|
||||
public void EndpointDispatcherAddTest8 ()
|
||||
{
|
||||
var uri = CreateAvailableUri ("http://localhost:37564");
|
||||
var uri = CreateAvailableUri ("http://localhost:" + NetworkHelpers.FindFreePort ());
|
||||
ServiceHost h = new ServiceHost (typeof (TestContract), uri);
|
||||
var listener = new MyChannelListener<IReplyChannel> (uri);
|
||||
MyChannelDispatcher d = new MyChannelDispatcher (listener);
|
||||
@@ -282,7 +284,7 @@ namespace MonoTests.System.ServiceModel.Dispatcher
|
||||
// [Test]
|
||||
public void EndpointDispatcherAddTest9 () // test singleton service
|
||||
{
|
||||
var uri = CreateAvailableUri ("http://localhost:37564");
|
||||
var uri = CreateAvailableUri ("http://localhost:" + NetworkHelpers.FindFreePort ());
|
||||
ServiceHost h = new ServiceHost (new TestContract (), uri);
|
||||
h.Description.Behaviors.Find<ServiceBehaviorAttribute> ().InstanceContextMode = InstanceContextMode.Single;
|
||||
var listener = new MyChannelListener<IReplyChannel> (uri);
|
||||
|
@@ -37,6 +37,8 @@ using System.ServiceModel.Security;
|
||||
using System.Xml;
|
||||
using NUnit.Framework;
|
||||
|
||||
using MonoTests.Helpers;
|
||||
|
||||
namespace MonoTests.System.ServiceModel.Dispatcher
|
||||
{
|
||||
[TestFixture]
|
||||
@@ -88,11 +90,12 @@ namespace MonoTests.System.ServiceModel.Dispatcher
|
||||
public void FaultContractInfos ()
|
||||
{
|
||||
var host = new ServiceHost (typeof (TestFaultContract));
|
||||
int port = NetworkHelpers.FindFreePort ();
|
||||
host.Description.Behaviors.Find<ServiceDebugBehavior> ().IncludeExceptionDetailInFaults = false;
|
||||
host.AddServiceEndpoint (typeof (ITestFaultContract), new BasicHttpBinding (), new Uri ("http://localhost:37564"));
|
||||
host.AddServiceEndpoint (typeof (ITestFaultContract), new BasicHttpBinding (), new Uri ("http://localhost:" + port));
|
||||
host.Open ();
|
||||
try {
|
||||
var cf = new ChannelFactory<ITestFaultContract> (new BasicHttpBinding (), new EndpointAddress ("http://localhost:37564"));
|
||||
var cf = new ChannelFactory<ITestFaultContract> (new BasicHttpBinding (), new EndpointAddress ("http://localhost:" + port));
|
||||
var cli = cf.CreateChannel ();
|
||||
try {
|
||||
cli.Run ("default");
|
||||
@@ -178,4 +181,4 @@ namespace MonoTests.System.ServiceModel.Dispatcher
|
||||
{ }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user