-
Notifications
You must be signed in to change notification settings - Fork 648
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automatically enable ImplicitDistributedTransactions on windows when …
…transaction mode requires it (#6850) * Addd failing test * Automatically enable ImplicitDistributedTransactions on windows when transaction mode requires it * Tweaks --------- Co-authored-by: Brandon Ording <bording@gmail.com>
- Loading branch information
1 parent
8ca3028
commit ad78c37
Showing
6 changed files
with
94 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
...AcceptanceTests/Core/Transactions/When_transport_supports_transaction_scope_on_windows.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
namespace NServiceBus.AcceptanceTests.Core.UnitOfWork.TransactionScope | ||
{ | ||
using System; | ||
using System.Threading.Tasks; | ||
using AcceptanceTesting; | ||
using EndpointTemplates; | ||
using FakeTransport; | ||
using NUnit.Framework; | ||
|
||
public class When_transport_supports_transaction_scope_on_windows : NServiceBusAcceptanceTest | ||
{ | ||
[Test] | ||
public async Task Should_support_dtc() | ||
{ | ||
if (!OperatingSystem.IsWindows()) | ||
{ | ||
Assert.Ignore("Only relevant on windows"); | ||
} | ||
|
||
var fakeTransport = new FakeTransport | ||
{ | ||
TransportTransactionMode = TransportTransactionMode.TransactionScope | ||
}; | ||
|
||
await Scenario.Define<ScenarioContext>() | ||
.WithEndpoint<TransactionScopeEndpoint>(b => b.CustomConfig(c => | ||
{ | ||
c.UseTransport(fakeTransport); | ||
})) | ||
.Done(c => c.EndpointsStarted) | ||
.Run(); | ||
|
||
Assert.True(fakeTransport.DtcIsAvailable, fakeTransport.DtcCheckException?.Message); | ||
} | ||
|
||
public class TransactionScopeEndpoint : EndpointConfigurationBuilder | ||
{ | ||
public TransactionScopeEndpoint() | ||
{ | ||
EndpointSetup<DefaultServer>(); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters