Imported Upstream version 5.20.0.180

Former-commit-id: ff953ca879339fe1e1211f7220f563e1342e66cb
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-02-04 20:11:37 +00:00
parent 0e2d47d1c8
commit 0510252385
3360 changed files with 83827 additions and 39243 deletions

View File

@@ -38,6 +38,8 @@ using System.ServiceModel.Configuration;
using System.Configuration;
using System.Text;
using MonoTests.Helpers;
namespace MonoTests.System.ServiceModel
{
[TestFixture]
@@ -316,7 +318,7 @@ namespace MonoTests.System.ServiceModel
private BasicHttpBinding CreateBindingFromConfig ()
{
ServiceModelSectionGroup config = (ServiceModelSectionGroup) ConfigurationManager.OpenExeConfiguration ("Test/config/basicHttpBinding").GetSectionGroup ("system.serviceModel");
ServiceModelSectionGroup config = (ServiceModelSectionGroup) ConfigurationManager.OpenExeConfiguration (TestResourceHelper.GetFullPathOfResource ("Test/config/basicHttpBinding")).GetSectionGroup ("system.serviceModel");
BindingsSection section = (BindingsSection) config.Bindings;
BasicHttpBindingElement el = section.BasicHttpBinding.Bindings ["BasicHttpBinding2_Service"];

View File

@@ -51,8 +51,8 @@ namespace MonoTests.System.ServiceModel
public class ClientCredentialsSecurityTokenManagerTest
{
MyManager def_c;
X509Certificate2 cert = new X509Certificate2 ("Test/Resources/test.pfx", "mono");
X509Certificate2 certpub = new X509Certificate2 ("Test/Resources/test.cer");
X509Certificate2 cert = new X509Certificate2 (TestResourceHelper.GetFullPathOfResource ("Test/Resources/test.pfx"), "mono");
X509Certificate2 certpub = new X509Certificate2 (TestResourceHelper.GetFullPathOfResource ("Test/Resources/test.cer"));
[SetUp]
public void Initialize ()

View File

@@ -40,6 +40,8 @@ using System.Xml.Schema;
using System.Xml.Serialization;
using NUnit.Framework;
using MonoTests.Helpers;
namespace MonoTests.System.ServiceModel
{
[TestFixture]
@@ -371,7 +373,7 @@ namespace MonoTests.System.ServiceModel
[Test]
public void WriteToWSA10 ()
{
X509Certificate2 cert = new X509Certificate2 ("Test/Resources/test.cer");
X509Certificate2 cert = new X509Certificate2 (TestResourceHelper.GetFullPathOfResource ("Test/Resources/test.cer"));
EndpointAddress a = new EndpointAddress (
new Uri ("http://localhost:8080"),
new X509CertificateEndpointIdentity (cert));
@@ -387,7 +389,7 @@ namespace MonoTests.System.ServiceModel
[Test]
public void WriteContentsToWSA10 ()
{
X509Certificate2 cert = new X509Certificate2 ("Test/Resources/test.cer");
X509Certificate2 cert = new X509Certificate2 (TestResourceHelper.GetFullPathOfResource ("Test/Resources/test.cer"));
EndpointAddress a = new EndpointAddress (
new Uri ("http://localhost:8080"),
new X509CertificateEndpointIdentity (cert));

View File

@@ -36,12 +36,14 @@ using System.ServiceModel;
using System.Xml;
using NUnit.Framework;
using MonoTests.Helpers;
namespace MonoTests.System.ServiceModel
{
[TestFixture]
public class EndpointIdentityTest
{
static readonly X509Certificate2 cert = new X509Certificate2 ("Test/Resources/test.cer");
static readonly X509Certificate2 cert = new X509Certificate2 (TestResourceHelper.GetFullPathOfResource ("Test/Resources/test.cer"));
[Test]
public void CreateX509CertificateIdentity ()

View File

@@ -0,0 +1,51 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Threading;
using NUnit.Framework;
namespace MonoTests.System.ServiceModel
{
[TestFixture]
public class SynchronizedCollectionTest
{
[Test] // from https://bugzilla.xamarin.com/show_bug.cgi?id=43447
public void TestConcurrentAddRemove ()
{
var c = new SynchronizedCollection<int> ();
for (int i = 0; i < 10000; i++)
{
c.Add(i);
}
var wait = new CountdownEvent (2);
ThreadStart add = () =>
{
wait.Signal ();
wait.Wait ();
for (int i = 10000; i < 20000; i++)
{
c.Add (i);
}
};
ThreadStart remove = () =>
{
wait.Signal ();
wait.Wait ();
for(int i = 9999; i >= 0; i--)
{
c.Remove (i);
}
};
var t1 = new Thread (add);
var t2 = new Thread (remove);
t1.Start ();
t2.Start ();
t1.Join ();
t2.Join ();
}
}
}

View File

@@ -37,7 +37,7 @@ namespace MonoTests.System.ServiceModel
Assert.IsFalse (((IList) d).Contains (null));
}
[Test, ExpectedException (typeof (ArgumentException))]
[Test]
public void TestICollectionCopyTo ()
{
SynchronizedReadOnlyCollection<int> c = new SynchronizedReadOnlyCollection<int> ();