Imported Upstream version 3.8.0

Former-commit-id: 6a76a29bd07d86e57c6c8da45c65ed5447d38a61
This commit is contained in:
Jo Shields
2014-09-04 09:07:35 +01:00
parent a575963da9
commit fe777c5c82
1062 changed files with 12460 additions and 5983 deletions

View File

@ -52,11 +52,7 @@ namespace System.ServiceModel.Channels
MessageEncoder = CreateEncoder<TChannel> (mbe);
continue;
}
#if NET_2_1
var cbe = be as HttpCookieContainerBindingElement;
if (cbe != null)
cookie_manager = cbe.GetProperty<IHttpCookieContainerManager> (ctx);
#elif NET_4_0
#if NET_2_1 || NET_4_0
var tbe = be as HttpTransportBindingElement;
if (tbe != null)
cookie_manager = tbe.GetProperty<IHttpCookieContainerManager> (ctx);

View File

@ -69,7 +69,7 @@ namespace MonoTests.System.ServiceModel.Description
Assert.AreEqual (MessageVersion.Soap12WSAddressing10, b.GetProperty<MessageVersion> (new BindingParameterCollection ()), "#6");
var host = new ServiceHost (typeof (MetadataExchange));
host.AddServiceEndpoint (typeof (IMetadataExchange), MetadataExchangeBindings.CreateMexHttpBinding (), CreateUri ("http://localhost:8080"));
host.AddServiceEndpoint (typeof (IMetadataExchange), MetadataExchangeBindings.CreateMexHttpBinding (), CreateUri ("http://localhost:30158"));
host.Open ();
try {
// it still does not rewrite MessageVersion.None. It's rather likely ServiceMetadataExtension which does overwriting.
@ -96,7 +96,7 @@ namespace MonoTests.System.ServiceModel.Description
Assert.AreEqual(Uri.UriSchemeHttps, b.Scheme, "#8");
var host = new ServiceHost(typeof(MetadataExchange));
host.AddServiceEndpoint(typeof(IMetadataExchange), MetadataExchangeBindings.CreateMexHttpsBinding(), CreateUri("https://localhost:8080"));
host.AddServiceEndpoint(typeof(IMetadataExchange), MetadataExchangeBindings.CreateMexHttpsBinding(), CreateUri("https://localhost:30158"));
host.Open();
try
{

View File

@ -56,7 +56,7 @@ namespace MonoTests.System.ServiceModel.Description
[Test]
public void InitializeRuntime1 () {
using (ServiceHost host = new ServiceHost (typeof (MyService), new Uri ("http://localhost:8080"))) {
using (ServiceHost host = new ServiceHost (typeof (MyService), new Uri ("http://localhost:30158"))) {
host.AddServiceEndpoint (typeof (IMyContract), new BasicHttpBinding (), "e1");
host.Description.Behaviors.Add (new ServiceMetadataBehavior () { HttpGetEnabled = true });
@ -93,10 +93,10 @@ namespace MonoTests.System.ServiceModel.Description
[Test]
public void InitializeRuntime2 () {
using (ServiceHost host = new ServiceHost (typeof (MyService), new Uri ("http://localhost:8080"))) {
using (ServiceHost host = new ServiceHost (typeof (MyService), new Uri ("http://localhost:30158"))) {
host.AddServiceEndpoint (typeof (IMyContract), new BasicHttpBinding (), "");
host.Description.Behaviors.Add (new ServiceMetadataBehavior () { HttpGetEnabled = true, HttpGetUrl = new Uri ("http://localhost:8080/mex_and_help") });
host.Description.Behaviors.Find<ServiceDebugBehavior> ().HttpHelpPageUrl = new Uri ("http://localhost:8080/mex_and_help");
host.Description.Behaviors.Add (new ServiceMetadataBehavior () { HttpGetEnabled = true, HttpGetUrl = new Uri ("http://localhost:30158/mex_and_help") });
host.Description.Behaviors.Find<ServiceDebugBehavior> ().HttpHelpPageUrl = new Uri ("http://localhost:30158/mex_and_help");
Assert.AreEqual (0, host.ChannelDispatchers.Count, "ChannelDispatchers.Count #1");
@ -125,10 +125,10 @@ namespace MonoTests.System.ServiceModel.Description
[Test]
public void InitializeRuntime3 () {
using (ServiceHost host = new ServiceHost (typeof (MyService), new Uri ("http://localhost:8080"))) {
using (ServiceHost host = new ServiceHost (typeof (MyService), new Uri ("http://localhost:30158"))) {
host.AddServiceEndpoint (typeof (IMyContract), new BasicHttpBinding (), "");
host.Description.Behaviors.Add (new ServiceMetadataBehavior () { HttpGetEnabled = true, HttpGetUrl = new Uri ("http://localhost:8080/mex") });
host.Description.Behaviors.Find<ServiceDebugBehavior> ().HttpHelpPageUrl = new Uri ("http://localhost:8080/help");
host.Description.Behaviors.Add (new ServiceMetadataBehavior () { HttpGetEnabled = true, HttpGetUrl = new Uri ("http://localhost:30158/mex") });
host.Description.Behaviors.Find<ServiceDebugBehavior> ().HttpHelpPageUrl = new Uri ("http://localhost:30158/help");
Assert.AreEqual (0, host.ChannelDispatchers.Count, "ChannelDispatchers.Count #1");
@ -176,9 +176,9 @@ namespace MonoTests.System.ServiceModel.Description
[Test]
public void InitializeRuntime4 () {
using (ServiceHost host = new ServiceHost (typeof (MyService), new Uri ("http://localhost:8080"))) {
using (ServiceHost host = new ServiceHost (typeof (MyService), new Uri ("http://localhost:30158"))) {
host.AddServiceEndpoint (typeof (IMyContract), new BasicHttpBinding (), "");
host.Description.Behaviors.Add (new ServiceMetadataBehavior () { HttpGetEnabled = true, HttpGetUrl = new Uri ("http://localhost:8080/mex") });
host.Description.Behaviors.Add (new ServiceMetadataBehavior () { HttpGetEnabled = true, HttpGetUrl = new Uri ("http://localhost:30158/mex") });
host.Description.Behaviors.Remove<ServiceDebugBehavior> ();
Assert.AreEqual (0, host.ChannelDispatchers.Count, "ChannelDispatchers.Count #1");
@ -204,7 +204,7 @@ namespace MonoTests.System.ServiceModel.Description
Assert.AreEqual (0, ed.FilterPriority, "FilterPriority");
EndpointAddress ea = ed.EndpointAddress;
Assert.AreEqual (new Uri ("http://localhost:8080/mex"), ea.Uri, "Uri");
Assert.AreEqual (new Uri ("http://localhost:30158/mex"), ea.Uri, "Uri");
DispatchRuntime dr = ed.DispatchRuntime;
Assert.AreEqual (1, dr.Operations.Count, "Operations.Count");
@ -221,9 +221,9 @@ namespace MonoTests.System.ServiceModel.Description
[Test]
public void ServiceMetadataExtension1 () {
using (ServiceHost host = new ServiceHost (typeof (MyService), new Uri ("http://localhost:8080"))) {
using (ServiceHost host = new ServiceHost (typeof (MyService), new Uri ("http://localhost:30158"))) {
host.AddServiceEndpoint (typeof (IMyContract), new BasicHttpBinding (), "");
host.Description.Behaviors.Add (new ServiceMetadataBehavior () { HttpGetEnabled = true, HttpGetUrl = new Uri ("http://localhost:8080/mex") });
host.Description.Behaviors.Add (new ServiceMetadataBehavior () { HttpGetEnabled = true, HttpGetUrl = new Uri ("http://localhost:30158/mex") });
host.Description.Behaviors.Remove<ServiceDebugBehavior> ();
host.Open ();
@ -237,9 +237,9 @@ namespace MonoTests.System.ServiceModel.Description
[Test]
public void ServiceMetadataExtension2 () {
using (ServiceHost host = new ServiceHost (typeof (MyService), new Uri ("http://localhost:8080"))) {
using (ServiceHost host = new ServiceHost (typeof (MyService), new Uri ("http://localhost:30158"))) {
host.AddServiceEndpoint (typeof (IMyContract), new BasicHttpBinding (), "");
host.Description.Behaviors.Add (new ServiceMetadataBehavior () { HttpGetEnabled = true, HttpGetUrl = new Uri ("http://localhost:8080/mex") });
host.Description.Behaviors.Add (new ServiceMetadataBehavior () { HttpGetEnabled = true, HttpGetUrl = new Uri ("http://localhost:30158/mex") });
host.Description.Behaviors.Remove<ServiceDebugBehavior> ();
ServiceMetadataExtension extension = new ServiceMetadataExtension ();

View File

@ -53,7 +53,7 @@ namespace MonoTests.System.ServiceModel.Dispatcher
// free to change if MS implementation does not make
// sense.
DispatchRuntime r = new EndpointDispatcher (
new EndpointAddress ("http://localhost:8080"), "IFoo", "urn:foo").DispatchRuntime;
new EndpointAddress ("http://localhost:30158"), "IFoo", "urn:foo").DispatchRuntime;
Assert.AreEqual (AuditLogLocation.Default,
r.SecurityAuditLogLocation, "#1");
@ -153,7 +153,7 @@ namespace MonoTests.System.ServiceModel.Dispatcher
void TestInstanceBehavior (MessageInspectBehavior b, string expected, Result actual, int invocations)
{
ServiceHost h = new ServiceHost (typeof (AllActions), new Uri ("http://localhost:8080"));
ServiceHost h = new ServiceHost (typeof (AllActions), new Uri ("http://localhost:30158"));
try {
h.AddServiceEndpoint (typeof (IAllActions).FullName, new BasicHttpBinding (), "AllActions");
h.Description.Behaviors.Add (b);
@ -167,7 +167,7 @@ namespace MonoTests.System.ServiceModel.Dispatcher
Assert.AreEqual (typeof (AllActions), ed.DispatchRuntime.Type, "Type property: " + ed.ContractName);
}
}
AllActionsProxy p = new AllActionsProxy (new BasicHttpBinding () { SendTimeout = TimeSpan.FromSeconds (5), ReceiveTimeout = TimeSpan.FromSeconds (5) }, new EndpointAddress ("http://localhost:8080/AllActions"));
AllActionsProxy p = new AllActionsProxy (new BasicHttpBinding () { SendTimeout = TimeSpan.FromSeconds (5), ReceiveTimeout = TimeSpan.FromSeconds (5) }, new EndpointAddress ("http://localhost:30158/AllActions"));
for (int i = 0; i < invocations; ++i)
p.Get (10);

View File

@ -30,6 +30,7 @@ namespace MonoTests.System.ServiceModel.PeerResolvers
}
[Test]
[Category ("NotWorking")]
public void CloseTest ()
{
cprs.Open ();
@ -79,6 +80,7 @@ namespace MonoTests.System.ServiceModel.PeerResolvers
[Test]
[ExpectedException (typeof (InvalidOperationException))]
[Category ("NotWorking")]
public void OpenTest4 ()
{
cprs.Open ();

View File

@ -483,12 +483,12 @@ namespace MonoTests.System.ServiceModel
var host = new ServiceHost (typeof (OneWayService));
host.AddServiceEndpoint (typeof (IOneWayService),
new BasicHttpBinding (),
new Uri ("http://localhost:8080"));
new Uri ("http://localhost:30158"));
host.Open ();
try {
var cf = new ChannelFactory<IOneWayService> (
new BasicHttpBinding (),
new EndpointAddress ("http://localhost:8080"));
new EndpointAddress ("http://localhost:30158"));
var ch = cf.CreateChannel ();
ch.GiveMessage ("test");

View File

@ -159,7 +159,7 @@ namespace MonoTests.System.ServiceModel
[Test]
public void ChannelDispatchers_NoDebug () {
ServiceHost h = new ServiceHost (typeof (AllActions), new Uri ("http://localhost:8080"));
ServiceHost h = new ServiceHost (typeof (AllActions), new Uri ("http://localhost:30158"));
h.AddServiceEndpoint (typeof (AllActions).FullName, new BasicHttpBinding (), "address");
ServiceDebugBehavior b = h.Description.Behaviors.Find<ServiceDebugBehavior> ();
@ -173,7 +173,7 @@ namespace MonoTests.System.ServiceModel
Assert.IsTrue (channelDispatcher.Endpoints.Count == 1, "#2");
EndpointAddressMessageFilter filter = channelDispatcher.Endpoints [0].AddressFilter as EndpointAddressMessageFilter;
Assert.IsNotNull (filter, "#3");
Assert.IsTrue (filter.Address.Equals (new EndpointAddress ("http://localhost:8080/address")), "#4");
Assert.IsTrue (filter.Address.Equals (new EndpointAddress ("http://localhost:30158/address")), "#4");
Assert.IsFalse (filter.IncludeHostNameInComparison, "#5");
Assert.IsTrue (channelDispatcher.Endpoints [0].ContractFilter is MatchAllMessageFilter, "#6");
} finally {
@ -183,11 +183,11 @@ namespace MonoTests.System.ServiceModel
[Test]
public void ChannelDispatchers_WithDebug () {
ServiceHost h = new ServiceHost (typeof (AllActions), new Uri ("http://localhost:8080"));
ServiceHost h = new ServiceHost (typeof (AllActions), new Uri ("http://localhost:30158"));
h.AddServiceEndpoint (typeof (AllActions).FullName, new BasicHttpBinding (), "address");
ServiceMetadataBehavior b = new ServiceMetadataBehavior ();
b.HttpGetEnabled = true;
b.HttpGetUrl = new Uri( "http://localhost:8080" );
b.HttpGetUrl = new Uri( "http://localhost:30158" );
h.Description.Behaviors.Add (b);
h.Open ();
@ -197,7 +197,7 @@ namespace MonoTests.System.ServiceModel
Assert.IsTrue (channelDispatcher.Endpoints.Count == 1, "#3");
EndpointAddressMessageFilter filter = channelDispatcher.Endpoints [0].AddressFilter as EndpointAddressMessageFilter;
Assert.IsNotNull (filter, "#4");
Assert.IsTrue (filter.Address.Equals (new EndpointAddress ("http://localhost:8080")), "#5");
Assert.IsTrue (filter.Address.Equals (new EndpointAddress ("http://localhost:30158")), "#5");
Assert.IsFalse (filter.IncludeHostNameInComparison, "#6");
Assert.IsTrue (channelDispatcher.Endpoints [0].ContractFilter is MatchAllMessageFilter, "#7");
h.Close ();
@ -207,7 +207,7 @@ namespace MonoTests.System.ServiceModel
public void SpecificActionTest ()
{
//EndpointDispatcher d = new EndpointDispatcher(
ServiceHost h = new ServiceHost (typeof (SpecificAction), new Uri ("http://localhost:8080"));
ServiceHost h = new ServiceHost (typeof (SpecificAction), new Uri ("http://localhost:30158"));
h.AddServiceEndpoint (typeof (Action1Interface), new BasicHttpBinding (), "address");
h.Open ();
@ -222,7 +222,7 @@ namespace MonoTests.System.ServiceModel
[Test]
public void InitializeRuntimeBehaviors1 () {
HostState st = new HostState ();
ServiceHost h = new ServiceHost (typeof (SpecificAction2), new Uri ("http://localhost:8080"));
ServiceHost h = new ServiceHost (typeof (SpecificAction2), new Uri ("http://localhost:30158"));
h.AddServiceEndpoint (typeof (SpecificAction2), new BasicHttpBinding (), "temp");
h.Description.Behaviors.Add (new MyServiceBehavior (st, h));
@ -241,7 +241,7 @@ namespace MonoTests.System.ServiceModel
[Test]
public void InitializeRuntimeBehaviors2 () {
HostState st = new HostState ();
ServiceHost h = new ServiceHost (typeof (SpecificAction), new Uri ("http://localhost:8080"));
ServiceHost h = new ServiceHost (typeof (SpecificAction), new Uri ("http://localhost:30158"));
h.AddServiceEndpoint (typeof (Action1Interface), new BasicHttpBinding (), "temp");
h.AddServiceEndpoint (typeof (Action2Interface), new BasicHttpBinding (), "temp2");
@ -368,7 +368,7 @@ namespace MonoTests.System.ServiceModel
public void AddServiceEndpoint_Directly ()
{
var host = new ServiceHost (typeof (DummyService));
var address = new EndpointAddress ("http://localhost:8080");
var address = new EndpointAddress ("http://localhost:30158");
var binding = new BasicHttpBinding ();
var contract = ContractDescription.GetContract (typeof (IDummyService));
host.AddServiceEndpoint (new ServiceEndpoint (contract, binding, address));
@ -389,7 +389,7 @@ namespace MonoTests.System.ServiceModel
public void AddServiceEndpoint_Directly_NullBinding ()
{
var host = new ServiceHost (typeof (DummyService));
var address = new EndpointAddress ("http://localhost:8080");
var address = new EndpointAddress ("http://localhost:30158");
var contract = ContractDescription.GetContract (typeof (IDummyService));
host.AddServiceEndpoint (new ServiceEndpoint (contract, null, address));
}
@ -407,7 +407,7 @@ namespace MonoTests.System.ServiceModel
public void AddServiceEndpoint_Directly_ContractMismatch ()
{
var host = new ServiceHost (typeof (DummyService));
var address = new EndpointAddress ("http://localhost:8080");
var address = new EndpointAddress ("http://localhost:30158");
var binding = new BasicHttpBinding ();
var contract = ContractDescription.GetContract (typeof (INotImplementedService));
host.AddServiceEndpoint (new ServiceEndpoint (contract, binding, address));