Imported Upstream version 4.3.2.467

Former-commit-id: 9c2cb47f45fa221e661ab616387c9cda183f283d
This commit is contained in:
Xamarin Public Jenkins
2016-02-22 11:00:01 -05:00
parent f302175246
commit f3e3aab35a
4097 changed files with 122406 additions and 82300 deletions

View File

@@ -1009,5 +1009,82 @@ namespace MonoTests.System.ServiceModel.Description
[MyWebGet]
string Get ();
}
public interface IA1 : IB1, IB2
{
void MethodA1 ();
}
public interface IA2 : IB1, IB2
{
void MethodA2 ();
}
[ServiceContract]
public interface IB1 : IC1, IC2
{
[OperationContract]
void MethodB1 ();
}
[ServiceContract]
public interface IB2 : IC1, IC2
{
[OperationContract]
void MethodB2 ();
}
public interface IC1 {}
public interface IC2 {}
[ServiceContract]
public interface IS : IA1, IA2
{
[OperationContract]
void MethodS() ;
}
public class S : IS
{
#region IS implementation
public void MethodS ()
{
throw new NotImplementedException ();
}
#endregion
#region IA2 implementation
public void MethodA2 ()
{
throw new NotImplementedException ();
}
#endregion
#region IA1 implementation
public void MethodA1 ()
{
throw new NotImplementedException ();
}
#endregion
#region IB2 implementation
public void MethodB2 ()
{
throw new NotImplementedException ();
}
#endregion
#region IB1 implementation
public void MethodB1 ()
{
throw new NotImplementedException ();
}
#endregion
}
[Test]
public void DualSpreadingInheritanceTest()
{
var cd = ContractDescription.GetContract (typeof(S));
Assert.IsNotNull(cd);
Assert.IsTrue (cd.Name == "IS");
}
}
}

View File

@@ -38,21 +38,13 @@ using System.ServiceModel.Dispatcher;
using System.Text;
using NUnit.Framework;
using MonoTests.Helpers;
namespace MonoTests.System.ServiceModel.Description
{
[TestFixture]
public class MetadataExchangeBindingsTest
{
Uri CreateUri (string uriString)
{
var uri = new Uri (uriString);
var l = new TcpListener (uri.Port);
l.Start ();
l.Stop ();
return uri;
}
[Test]
public void CreateMexHttpBinding ()
{
@@ -69,7 +61,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:30158"));
host.AddServiceEndpoint (typeof (IMetadataExchange), MetadataExchangeBindings.CreateMexHttpBinding (), "http://localhost:" + NetworkHelpers.FindFreePort ());
host.Open ();
try {
// it still does not rewrite MessageVersion.None. It's rather likely ServiceMetadataExtension which does overwriting.
@@ -96,7 +88,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:30158"));
host.AddServiceEndpoint(typeof(IMetadataExchange), MetadataExchangeBindings.CreateMexHttpsBinding(), "https://localhost:" + NetworkHelpers.FindFreePort ());
host.Open();
try
{

View File

@@ -57,18 +57,9 @@ namespace MonoTests.System.ServiceModel.Description
}
}
Uri CreateUri (string uriString)
{
var uri = new Uri (uriString);
var l = new TcpListener (uri.Port);
l.Start ();
l.Stop ();
return uri;
}
[Test]
public void InitializeRuntime1 () {
using (ServiceHost host = new ServiceHost (typeof (MyService), CreateUri ("http://localhost:" + NetworkHelpers.FindFreePort ()))) {
using (ServiceHost host = new ServiceHost (typeof (MyService), new Uri ("http://localhost:" + NetworkHelpers.FindFreePort ()))) {
host.AddServiceEndpoint (typeof (IMyContract), new BasicHttpBinding (), "e1");
Assert.AreEqual (0, host.ChannelDispatchers.Count, "ChannelDispatchers.Count #1");
@@ -105,7 +96,7 @@ namespace MonoTests.System.ServiceModel.Description
[Test]
public void InitializeRuntime2 () {
using (ServiceHost host = new ServiceHost (typeof (MyService), CreateUri ("http://localhost:" + NetworkHelpers.FindFreePort ()))) {
using (ServiceHost host = new ServiceHost (typeof (MyService), new Uri ("http://localhost:" + NetworkHelpers.FindFreePort ()))) {
host.AddServiceEndpoint (typeof (IMyContract), new BasicHttpBinding (), "");
host.Description.Behaviors.Remove<ServiceDebugBehavior> ();
@@ -124,7 +115,7 @@ namespace MonoTests.System.ServiceModel.Description
[Test]
public void InitializeRuntime3 () {
using (ServiceHost host = new ServiceHost (typeof (MyService), CreateUri ("http://localhost:" + NetworkHelpers.FindFreePort ()))) {
using (ServiceHost host = new ServiceHost (typeof (MyService), new Uri ("http://localhost:" + NetworkHelpers.FindFreePort ()))) {
host.AddServiceEndpoint (typeof (IMyContract), new BasicHttpBinding (), "");
host.Description.Behaviors.Find<ServiceDebugBehavior> ().HttpHelpPageEnabled = false;
@@ -143,7 +134,7 @@ namespace MonoTests.System.ServiceModel.Description
[Test]
public void InitializeRuntime4 () {
int port = NetworkHelpers.FindFreePort ();
using (ServiceHost host = new ServiceHost (typeof (MyService), CreateUri ("http://localhost:" + port))) {
using (ServiceHost host = new ServiceHost (typeof (MyService), new Uri ("http://localhost:" + port))) {
host.AddServiceEndpoint (typeof (IMyContract), new BasicHttpBinding (), "");
host.Description.Behaviors.Find<ServiceDebugBehavior> ().HttpHelpPageUrl = new Uri ("http://localhost:" + port + "/help");
@@ -190,7 +181,7 @@ namespace MonoTests.System.ServiceModel.Description
[Test]
public void ServiceMetadataExtension1 () {
int port = NetworkHelpers.FindFreePort ();
using (ServiceHost host = new ServiceHost (typeof (MyService), CreateUri ("http://localhost:" + port))) {
using (ServiceHost host = new ServiceHost (typeof (MyService), new Uri ("http://localhost:" + port))) {
host.AddServiceEndpoint (typeof (IMyContract), new BasicHttpBinding (), "");
host.Description.Behaviors.Find<ServiceDebugBehavior> ().HttpHelpPageUrl = new Uri ("http://localhost:" + port + "/help");
try {
@@ -207,9 +198,9 @@ namespace MonoTests.System.ServiceModel.Description
[Test]
public void ServiceMetadataExtension2 () {
int port = NetworkHelpers.FindFreePort ();
using (ServiceHost host = new ServiceHost (typeof (MyService), CreateUri ("http://localhost:" + port))) {
using (ServiceHost host = new ServiceHost (typeof (MyService), new Uri ("http://localhost:" + port))) {
host.AddServiceEndpoint (typeof (IMyContract), new BasicHttpBinding (), "");
host.Description.Behaviors.Find<ServiceDebugBehavior> ().HttpHelpPageUrl = CreateUri ("http://localhost:" + port + "/help");
host.Description.Behaviors.Find<ServiceDebugBehavior> ().HttpHelpPageUrl = new Uri ("http://localhost:" + port + "/help");
ServiceMetadataExtension extension = new ServiceMetadataExtension ();
host.Extensions.Add (extension);

View File

@@ -25,7 +25,6 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_4_0
using System;
using System.Collections.Generic;
@@ -54,4 +53,3 @@ namespace MonoTests.System.ServiceModel.Description
}
}
}
#endif