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

@@ -51,8 +51,8 @@ namespace MonoTests.System.ServiceModel.Channels
[TestFixture]
public class AsymmetricSecurityBindingElementTest
{
static X509Certificate2 cert = new X509Certificate2 ("Test/Resources/test.pfx", "mono");
static X509Certificate2 cert2 = new X509Certificate2 ("Test/Resources/test.cer");
static X509Certificate2 cert = new X509Certificate2 (TestResourceHelper.GetFullPathOfResource ("Test/Resources/test.pfx"), "mono");
static X509Certificate2 cert2 = new X509Certificate2 (TestResourceHelper.GetFullPathOfResource ("Test/Resources/test.cer"));
// InitiatorTokenParameters should have asymmetric key.
[Test]
@@ -246,7 +246,7 @@ namespace MonoTests.System.ServiceModel.Channels
binding, new Uri ("http://localhost:" + NetworkHelpers.FindFreePort ()));
ServiceCredentials cred = new ServiceCredentials ();
cred.ServiceCertificate.Certificate =
new X509Certificate2 ("Test/Resources/test.pfx", "mono");
new X509Certificate2 (TestResourceHelper.GetFullPathOfResource ("Test/Resources/test.pfx"), "mono");
cred.ClientCertificate.Authentication.CertificateValidationMode =
X509CertificateValidationMode.None;
host.Description.Behaviors.Add (cred);

View File

@@ -119,7 +119,7 @@ namespace MonoTests.System.ServiceModel.Channels
[Test]
public void ReadMessage ()
{
using (var ms = File.OpenRead ("Test/System.ServiceModel.Channels/binary-message.raw")) {
using (var ms = File.OpenRead (TestResourceHelper.GetFullPathOfResource ("Test/Resources/binary-message.raw"))) {
var session = new XmlBinaryReaderSession ();
byte [] rsbuf = new BinaryFrameSupportReader (ms).ReadSizedChunk ();

View File

@@ -215,7 +215,7 @@ namespace MonoTests.System.ServiceModel.Channels
EndpointAddress address = new EndpointAddress (
new Uri ("http://localhost:" + NetworkHelpers.FindFreePort ()),
new X509CertificateEndpointIdentity (new X509Certificate2 ("Test/Resources/test.pfx", "mono")));
new X509CertificateEndpointIdentity (new X509Certificate2 (TestResourceHelper.GetFullPathOfResource ("Test/Resources/test.pfx"), "mono")));
ChannelFactory<IRequestChannel> cf =
new ChannelFactory<IRequestChannel> (binding, address);
@@ -263,7 +263,7 @@ namespace MonoTests.System.ServiceModel.Channels
EndpointAddress address = new EndpointAddress (
new Uri ("http://localhost:" + NetworkHelpers.FindFreePort ()),
new X509CertificateEndpointIdentity (new X509Certificate2 ("Test/Resources/test.pfx", "mono")));
new X509CertificateEndpointIdentity (new X509Certificate2 (TestResourceHelper.GetFullPathOfResource ("Test/Resources/test.pfx"), "mono")));
ChannelProtectionRequirements reqs =
new ChannelProtectionRequirements ();

View File

@@ -8,6 +8,8 @@ using System.Text;
using System.Xml;
using NUnit.Framework;
using MonoTests.Helpers;
namespace MonoTests.System.ServiceModel.Channels
{
[TestFixture]
@@ -16,7 +18,7 @@ namespace MonoTests.System.ServiceModel.Channels
[Test]
public void CreateFault ()
{
var msg = Message.CreateMessage (XmlReader.Create (new StreamReader ("Test/System.ServiceModel.Channels/soap-fault.xml")), 0x10000, MessageVersion.Default);
var msg = Message.CreateMessage (XmlReader.Create (new StreamReader (TestResourceHelper.GetFullPathOfResource ("Test/Resources/soap-fault.xml"))), 0x10000, MessageVersion.Default);
MessageFault.CreateFault (msg, 0x10000);
}
@@ -33,7 +35,7 @@ namespace MonoTests.System.ServiceModel.Channels
[ExpectedException (typeof (CommunicationException))]
public void CreateFaultIncomplete ()
{
var msg = Message.CreateMessage (XmlReader.Create (new StreamReader ("Test/System.ServiceModel.Channels/soap-fault-incomplete.xml")), 0x10000, MessageVersion.Default);
var msg = Message.CreateMessage (XmlReader.Create (new StreamReader (TestResourceHelper.GetFullPathOfResource ("Test/Resources/soap-fault-incomplete.xml"))), 0x10000, MessageVersion.Default);
MessageFault.CreateFault (msg, 0x10000);
}
@@ -55,7 +57,7 @@ namespace MonoTests.System.ServiceModel.Channels
[ExpectedException (typeof (CommunicationException))]
public void CreateFaultIncomplete4 ()
{
var msg = Message.CreateMessage (XmlReader.Create (new StreamReader ("Test/System.ServiceModel.Channels/soap-fault-incomplete4.xml")), 0x10000, MessageVersion.Default);
var msg = Message.CreateMessage (XmlReader.Create (new StreamReader (TestResourceHelper.GetFullPathOfResource ("Test/Resources/soap-fault-incomplete4.xml"))), 0x10000, MessageVersion.Default);
MessageFault.CreateFault (msg, 0x10000);
}

View File

@@ -430,7 +430,7 @@ namespace MonoTests.System.ServiceModel.Channels
Binding b = new CustomBinding (be, new HttpTransportBindingElement ());
ClientCredentials cred = new ClientCredentials ();
cred.ClientCertificate.Certificate =
new X509Certificate2 ("Test/Resources/test.pfx", "mono");
new X509Certificate2 (TestResourceHelper.GetFullPathOfResource ("Test/Resources/test.pfx"), "mono");
IChannelFactory<IReplyChannel> ch = b.BuildChannelFactory<IReplyChannel> (new Uri ("http://localhost:" + NetworkHelpers.FindFreePort ()), cred);
try {
ch.Open ();
@@ -458,7 +458,7 @@ namespace MonoTests.System.ServiceModel.Channels
Binding b = new CustomBinding (be, new HttpTransportBindingElement ());
ServiceCredentials cred = new ServiceCredentials ();
cred.ServiceCertificate.Certificate =
new X509Certificate2 ("Test/Resources/test.pfx", "mono");
new X509Certificate2 (TestResourceHelper.GetFullPathOfResource ("Test/Resources/test.pfx"), "mono");
IChannelListener<IReplyChannel> ch = b.BuildChannelListener<IReplyChannel> (new Uri ("http://localhost:" + NetworkHelpers.FindFreePort ()), cred);
try {
ch.Open ();
@@ -480,7 +480,7 @@ namespace MonoTests.System.ServiceModel.Channels
be.EndpointSupportingTokenParameters.Endorsing.Add (
new UserNameSecurityTokenParameters ());
Binding b = new CustomBinding (be, new HttpTransportBindingElement ());
X509Certificate2 cert = new X509Certificate2 ("Test/Resources/test.pfx", "mono");
X509Certificate2 cert = new X509Certificate2 (TestResourceHelper.GetFullPathOfResource ("Test/Resources/test.pfx"), "mono");
EndpointAddress ea = new EndpointAddress (new Uri ("http://localhost:" + NetworkHelpers.FindFreePort ()), new X509CertificateEndpointIdentity (cert));
CalcProxy client = new CalcProxy (b, ea);
client.ClientCredentials.UserName.UserName = "rupert";

View File

@@ -37,6 +37,8 @@ using System.ServiceModel.Security;
using System.Text;
using NUnit.Framework;
using MonoTests.Helpers;
namespace MonoTests.System.ServiceModel.Channels
{
[TestFixture]
@@ -100,7 +102,7 @@ namespace MonoTests.System.ServiceModel.Channels
{
ServiceCredentials cred = new ServiceCredentials ();
X509Certificate2 cert =
new X509Certificate2 ("Test/Resources/test.cer");
new X509Certificate2 (TestResourceHelper.GetFullPathOfResource ("Test/Resources/test.cer"));
cred.ServiceCertificate.Certificate = cert;
X509CertificateEndpointIdentity ident =
new X509CertificateEndpointIdentity (cert);

View File

@@ -42,6 +42,8 @@ using System.ServiceModel.Security.Tokens;
using System.Xml;
using NUnit.Framework;
using MonoTests.Helpers;
namespace MonoTests.System.ServiceModel.Channels
{
[TestFixture]
@@ -150,7 +152,7 @@ namespace MonoTests.System.ServiceModel.Channels
EndpointAddress CreateX509EndpointAddress (string uri)
{
EndpointIdentity identity =
new X509CertificateEndpointIdentity (new X509Certificate2 ("Test/Resources/test.pfx", "mono"));
new X509CertificateEndpointIdentity (new X509Certificate2 (TestResourceHelper.GetFullPathOfResource ("Test/Resources/test.pfx"), "mono"));
return new EndpointAddress (new Uri (uri), identity);
}
@@ -161,7 +163,7 @@ namespace MonoTests.System.ServiceModel.Channels
new BindingParameterCollection ();
ServiceCredentials cred = new ServiceCredentials ();
cred.ServiceCertificate.Certificate =
new X509Certificate2 ("Test/Resources/test.pfx", "mono");
new X509Certificate2 (TestResourceHelper.GetFullPathOfResource ("Test/Resources/test.pfx"), "mono");
IServiceBehavior sb = cred;
sb.AddBindingParameters (null, null, null, bpl);
IChannelListener<IReplyChannel> listener = rb.BuildChannelListener<IReplyChannel> (bpl);
@@ -239,7 +241,7 @@ namespace MonoTests.System.ServiceModel.Channels
return null;
});
ClientCredentials cred = new ClientCredentials ();
cred.ServiceCertificate.DefaultCertificate = new X509Certificate2 ("Test/Resources/test.pfx", "mono");
cred.ServiceCertificate.DefaultCertificate = new X509Certificate2 (TestResourceHelper.GetFullPathOfResource ("Test/Resources/test.pfx"), "mono");
BindingParameterCollection parameters =
new BindingParameterCollection ();
parameters.Add (cred);
@@ -486,7 +488,7 @@ namespace MonoTests.System.ServiceModel.Channels
new BindingParameterCollection ();
ServiceCredentials cred = new ServiceCredentials ();
cred.ServiceCertificate.Certificate =
new X509Certificate2 ("Test/Resources/test.cer");
new X509Certificate2 (TestResourceHelper.GetFullPathOfResource ("Test/Resources/test.cer"));
IServiceBehavior sb = cred;
sb.AddBindingParameters (null, null, null, bpl);
IChannelListener<IReplyChannel> listener = rb.BuildChannelListener<IReplyChannel> (bpl);
@@ -551,7 +553,7 @@ Console.Error.WriteLine ("Processing a reply.");
public void FullRequest ()
{
EndpointIdentity identity =
new X509CertificateEndpointIdentity (new X509Certificate2 ("Test/Resources/test.pfx", "mono"));
new X509CertificateEndpointIdentity (new X509Certificate2 (TestResourceHelper.GetFullPathOfResource ("Test/Resources/test.pfx"), "mono"));
EndpointAddress address =
new EndpointAddress (new Uri ("stream:dummy"), identity);

View File

@@ -1,13 +0,0 @@
<s:Envelope xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Header>
<a:Action s:mustUnderstand="1">http://www.w3.org/2005/08/addressing/soap/fault</a:Action>
<a:To s:mustUnderstand="1">http://www.w3.org/2005/08/addressing/anonymous</a:To>
</s:Header>
<s:Body>
<s:Fault>
<s:Code>
<s:Value>s:Sender</s:Value>
</s:Code>
</s:Fault>
</s:Body>
</s:Envelope>

View File

@@ -1,14 +0,0 @@
<s:Envelope xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Header>
<a:Action s:mustUnderstand="1">http://www.w3.org/2005/08/addressing/soap/fault</a:Action>
<a:To s:mustUnderstand="1">http://www.w3.org/2005/08/addressing/anonymous</a:To>
</s:Header>
<s:Body>
<s:Fault>
<s:Code>
<s:Value>s:Sender</s:Value>
</s:Code>
<s:Reason><s:Text>There is some reason.</s:Text></s:Reason>
</s:Fault>
</s:Body>
</s:Envelope>

View File

@@ -1,14 +0,0 @@
<s:Envelope xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Header>
<a:Action s:mustUnderstand="1">http://www.w3.org/2005/08/addressing/soap/fault</a:Action>
<a:To s:mustUnderstand="1">http://www.w3.org/2005/08/addressing/anonymous</a:To>
</s:Header>
<s:Body>
<s:Fault>
<s:Code>
<s:Value>s:Sender</s:Value>
</s:Code>
<s:Reason><s:Text xml:lang='en'>There is some reason.</s:Text></s:Reason>
</s:Fault>
</s:Body>
</s:Envelope>