Imported Upstream version 5.4.0.167

Former-commit-id: 5624ac747d633e885131e8349322922b6a59baaa
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-08-21 15:34:15 +00:00
parent e49d6f06c0
commit 536cd135cc
12856 changed files with 563812 additions and 223249 deletions

View File

@@ -2,7 +2,8 @@
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\dir.props" />
<PropertyGroup>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyKey>Open</AssemblyKey>
<IsNETCoreApp>true</IsNETCoreApp>
<IsUAP>true</IsUAP>
</PropertyGroup>

View File

@@ -66,12 +66,13 @@ namespace System.Transactions.Distributed
protected DistributedTransaction(SerializationInfo serializationInfo, StreamingContext context)
{
if (serializationInfo == null)
{
throw new ArgumentNullException(nameof(serializationInfo));
}
//if (serializationInfo == null)
//{
// throw new ArgumentNullException(nameof(serializationInfo));
//}
throw NotSupported();
//throw NotSupported();
throw new PlatformNotSupportedException();
}
internal Exception InnerException { get; set; }
@@ -132,12 +133,14 @@ namespace System.Transactions.Distributed
void ISerializable.GetObjectData(SerializationInfo serializationInfo, StreamingContext context)
{
if (serializationInfo == null)
{
throw new ArgumentNullException(nameof(serializationInfo));
}
//if (serializationInfo == null)
//{
// throw new ArgumentNullException(nameof(serializationInfo));
//}
throw NotSupported();
//throw NotSupported();
throw new PlatformNotSupportedException();
}
internal static Exception NotSupported()

View File

@@ -908,37 +908,39 @@ namespace System.Transactions
SerializationInfo serializationInfo,
StreamingContext context)
{
TransactionsEtwProvider etwLog = TransactionsEtwProvider.Log;
if (etwLog.IsEnabled())
{
etwLog.MethodEnter(TraceSourceType.TraceSourceLtm, this);
}
//TransactionsEtwProvider etwLog = TransactionsEtwProvider.Log;
//if (etwLog.IsEnabled())
//{
// etwLog.MethodEnter(TraceSourceType.TraceSourceLtm, this);
//}
if (Disposed)
{
throw new ObjectDisposedException(nameof(Transaction));
}
//if (Disposed)
//{
// throw new ObjectDisposedException(nameof(Transaction));
//}
if (serializationInfo == null)
{
throw new ArgumentNullException(nameof(serializationInfo));
}
//if (serializationInfo == null)
//{
// throw new ArgumentNullException(nameof(serializationInfo));
//}
if (_complete)
{
throw TransactionException.CreateTransactionCompletedException(DistributedTxId);
}
//if (_complete)
//{
// throw TransactionException.CreateTransactionCompletedException(DistributedTxId);
//}
lock (_internalTransaction)
{
_internalTransaction.State.GetObjectData(_internalTransaction, serializationInfo, context);
}
//lock (_internalTransaction)
//{
// _internalTransaction.State.GetObjectData(_internalTransaction, serializationInfo, context);
//}
if (etwLog.IsEnabled())
{
etwLog.TransactionSerialized(this, "Transaction");
etwLog.MethodExit(TraceSourceType.TraceSourceLtm, this);
}
//if (etwLog.IsEnabled())
//{
// etwLog.TransactionSerialized(this, "Transaction");
// etwLog.MethodExit(TraceSourceType.TraceSourceLtm, this);
//}
throw new PlatformNotSupportedException();
}
/// <summary>

View File

@@ -100,6 +100,7 @@ namespace System.Transactions
/// <param name="context"></param>
protected TransactionException(SerializationInfo info, StreamingContext context) : base(info, context)
{
throw new PlatformNotSupportedException();
}
internal static TransactionException Create(string message, Guid distributedTxId)
@@ -241,6 +242,7 @@ namespace System.Transactions
/// <param name="context"></param>
protected TransactionAbortedException(SerializationInfo info, StreamingContext context) : base(info, context)
{
throw new PlatformNotSupportedException();
}
}
@@ -301,6 +303,7 @@ namespace System.Transactions
/// <param name="context"></param>
protected TransactionInDoubtException(SerializationInfo info, StreamingContext context) : base(info, context)
{
throw new PlatformNotSupportedException();
}
}
@@ -360,6 +363,7 @@ namespace System.Transactions
/// <param name="context"></param>
protected TransactionManagerCommunicationException(SerializationInfo info, StreamingContext context) : base(info, context)
{
throw new PlatformNotSupportedException();
}
}
@@ -398,6 +402,7 @@ namespace System.Transactions
/// <param name="context"></param>
protected TransactionPromotionException(SerializationInfo info, StreamingContext context) : base(info, context)
{
throw new PlatformNotSupportedException();
}
}
}

View File

@@ -1 +1 @@
4660c929b4fc447d538974e3b60fab51047daa08
473aaf607ddebff50b47fac92fc3e11adfe4fc48

View File

@@ -76,6 +76,7 @@ namespace System.Transactions.Tests
[InlineData(0, EnlistmentOptions.None, EnlistmentOptions.None, Phase1Vote.Prepared, Phase1Vote.Prepared, true, EnlistmentOutcome.Aborted, EnlistmentOutcome.Aborted, TransactionStatus.Aborted)]
[InlineData(1, EnlistmentOptions.None, EnlistmentOptions.None, Phase1Vote.Prepared, Phase1Vote.Prepared, true, EnlistmentOutcome.Aborted, EnlistmentOutcome.Aborted, TransactionStatus.Aborted)]
[InlineData(2, EnlistmentOptions.None, EnlistmentOptions.None, Phase1Vote.Prepared, Phase1Vote.Prepared, true, EnlistmentOutcome.Aborted, EnlistmentOutcome.Aborted, TransactionStatus.Aborted)]
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "Expects PNSE due to not being supported on core")]
public void TwoPhaseDurable(int volatileCount, EnlistmentOptions volatileEnlistmentOption, EnlistmentOptions durableEnlistmentOption, Phase1Vote volatilePhase1Vote, Phase1Vote durablePhase1Vote, bool commit, EnlistmentOutcome expectedVolatileOutcome, EnlistmentOutcome expectedDurableOutcome, TransactionStatus expectedTxStatus)
{
Transaction tx = null;

View File

@@ -2287,6 +2287,7 @@ namespace System.Transactions.Tests
}
[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "Expects PNSE due to not being supported on core")]
public void SimpleTransactionSuperior()
{
MySimpleTransactionSuperior superior = new MySimpleTransactionSuperior();

View File

@@ -0,0 +1,13 @@
<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
<Library>
<!-- VerifySoftDependencies() helper in test reflects on these types and caches a bunch of members -->
<Type Name="System.Transactions.IPromotableSinglePhaseNotification" Dynamic="Required Public" />
<Type Name="System.Transactions.Transaction" Dynamic="Required Public" />
<Type Name="System.Transactions.TransactionInterop" Dynamic="Required Public" />
<!-- XUnit causes indirect Reflection on these due to them appearing in InlineData attributes. -->
<Type Name="System.Transactions.TransactionScopeOption" Dynamic="Required Public" />
</Library>
</Directives>

View File

@@ -18,6 +18,12 @@
<Compile Include="HelperFunctions.cs" />
<Compile Include="TestEnlistments.cs" />
<Compile Include="TransactionTracingEventListener.cs" />
<Compile Include="$(CommonTestPath)\System\AssertExtensions.cs">
<Link>Common\System\AssertExtensions.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\$(AssemblyName).rd.xml" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
</Project>
</Project>

View File

@@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using Xunit;
namespace System.Transactions.Tests
@@ -13,8 +14,8 @@ namespace System.Transactions.Tests
[Fact]
public void TransactionScopeWithInvalidTimeSpanThrows()
{
Assert.Throws<ArgumentNullException>("transactionToUse", () => new TransactionScope(null, TimeSpan.FromSeconds(-1)));
Assert.Throws<ArgumentOutOfRangeException>("scopeTimeout", () => new TransactionScope(TransactionScopeOption.Required, TimeSpan.FromSeconds(-1)));
AssertExtensions.Throws<ArgumentNullException>("transactionToUse", () => new TransactionScope(null, TimeSpan.FromSeconds(-1)));
AssertExtensions.Throws<ArgumentOutOfRangeException>("scopeTimeout", () => new TransactionScope(TransactionScopeOption.Required, TimeSpan.FromSeconds(-1)));
}
[Fact]