-
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.
Merge branch 'hotfix-4.5.6' into support-4.5
- Loading branch information
Showing
17 changed files
with
383 additions
and
75 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
22 changes: 22 additions & 0 deletions
22
src/NServiceBus.AcceptanceTests/BasicMessaging/When_starting_a_send_only.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,22 @@ | ||
namespace NServiceBus.AcceptanceTests.BasicMessaging | ||
{ | ||
using System; | ||
using NUnit.Framework; | ||
|
||
public class When_starting_a_send_only : NServiceBusAcceptanceTest | ||
{ | ||
[Test] | ||
public void Should_not_need_audit_or_fault_forwarding_config_to_start() | ||
{ | ||
using ((IDisposable)Configure.With(new Type[] | ||
{ | ||
}) | ||
.DefaultBuilder() | ||
.UnicastBus() | ||
.SendOnly()) | ||
{ | ||
} | ||
|
||
} | ||
} | ||
} |
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
17 changes: 17 additions & 0 deletions
17
...iceBus.AcceptanceTests/Exceptions/Cant_convert_to_TransportMessage/SerializerCorrupter.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,17 @@ | ||
namespace NServiceBus.AcceptanceTests.Exceptions | ||
{ | ||
using System; | ||
using System.Reflection; | ||
|
||
static class SerializerCorrupter | ||
{ | ||
|
||
public static void Corrupt() | ||
{ | ||
var msmqUtilitiesType = Type.GetType("NServiceBus.Transports.Msmq.MsmqUtilities, NServiceBus.Core"); | ||
var headerSerializerField = msmqUtilitiesType.GetField("headerSerializer", BindingFlags.Static | BindingFlags.NonPublic); | ||
headerSerializerField.SetValue(null, null); | ||
} | ||
|
||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
...ests/Exceptions/Cant_convert_to_TransportMessage/When_cant_convert_to_TransportMessage.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,56 @@ | ||
namespace NServiceBus.AcceptanceTests.Exceptions | ||
{ | ||
using System; | ||
using System.Linq; | ||
using NServiceBus.AcceptanceTesting; | ||
using NServiceBus.AcceptanceTests.EndpointTemplates; | ||
using NUnit.Framework; | ||
|
||
public class When_cant_convert_to_TransportMessage : NServiceBusAcceptanceTest | ||
{ | ||
[Test] | ||
public void Should_send_message_to_error_queue() | ||
{ | ||
Scenario.Define<Context>() | ||
.WithEndpoint<Sender>(b => b.Given(bus => bus.Send(new Message()))) | ||
.WithEndpoint<Receiver>() | ||
.Done(c => c.GetAllLogs().Any(l => l.Level == "error")) | ||
.Repeat(r => r.For(ScenarioDescriptors.Transports.Msmq)) | ||
.Should(c => | ||
{ | ||
var logs = c.GetAllLogs(); | ||
Assert.True(logs.Any(l => l.Message.Contains("is corrupt and will be moved to"))); | ||
}) | ||
.Run(); | ||
} | ||
|
||
public class Context : ScenarioContext | ||
{ | ||
} | ||
|
||
public class Sender : EndpointConfigurationBuilder | ||
{ | ||
public Sender() | ||
{ | ||
EndpointSetup<DefaultServer>() | ||
.AddMapping<Message>(typeof(Receiver)); | ||
} | ||
} | ||
|
||
public class Receiver : EndpointConfigurationBuilder | ||
{ | ||
public Receiver() | ||
{ | ||
SerializerCorrupter.Corrupt(); | ||
EndpointSetup<DefaultServer>() | ||
.AllowExceptions(); | ||
} | ||
|
||
} | ||
|
||
[Serializable] | ||
public class Message : IMessage | ||
{ | ||
} | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
.../Cant_convert_to_TransportMessage/When_cant_convert_to_TransportMessage_NoTransactions.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,58 @@ | ||
namespace NServiceBus.AcceptanceTests.Exceptions | ||
{ | ||
using System; | ||
using System.Linq; | ||
using NServiceBus.AcceptanceTesting; | ||
using NServiceBus.AcceptanceTests.EndpointTemplates; | ||
using NUnit.Framework; | ||
using IMessage = NServiceBus.IMessage; | ||
|
||
public class When_cant_convert_to_TransportMessage_NoTransactions : NServiceBusAcceptanceTest | ||
{ | ||
[Test] | ||
public void Should_send_message_to_error_queue() | ||
{ | ||
Scenario.Define<Context>() | ||
.WithEndpoint<Sender>(b => b.Given(bus => bus.Send(new Message()))) | ||
.WithEndpoint<Receiver>() | ||
.Done(c => c.GetAllLogs().Any(l => l.Level == "error")) | ||
.Repeat(r => r.For(ScenarioDescriptors.Transports.Msmq)) | ||
.Should(c => | ||
{ | ||
var logs = c.GetAllLogs(); | ||
Assert.True(logs.Any(l => l.Message.Contains("is corrupt and will be moved to"))); | ||
}) | ||
.Run(); | ||
} | ||
|
||
public class Context : ScenarioContext | ||
{ | ||
} | ||
|
||
public class Sender : EndpointConfigurationBuilder | ||
{ | ||
public Sender() | ||
{ | ||
Configure.Transactions.Disable(); | ||
EndpointSetup<DefaultServer>() | ||
.AddMapping<Message>(typeof(Receiver)); | ||
} | ||
} | ||
|
||
public class Receiver : EndpointConfigurationBuilder | ||
{ | ||
public Receiver() | ||
{ | ||
SerializerCorrupter.Corrupt(); | ||
Configure.Transactions.Disable(); | ||
EndpointSetup<DefaultServer>() | ||
.AllowExceptions(); | ||
} | ||
} | ||
|
||
[Serializable] | ||
public class Message : IMessage | ||
{ | ||
} | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
...s/Cant_convert_to_TransportMessage/When_cant_convert_to_TransportMessage_SuppressedDTC.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,57 @@ | ||
namespace NServiceBus.AcceptanceTests.Exceptions | ||
{ | ||
using System; | ||
using System.Linq; | ||
using NServiceBus.AcceptanceTesting; | ||
using NServiceBus.AcceptanceTests.EndpointTemplates; | ||
using NUnit.Framework; | ||
|
||
public class When_cant_convert_to_TransportMessage_SuppressedDTC : NServiceBusAcceptanceTest | ||
{ | ||
[Test] | ||
public void Should_send_message_to_error_queue() | ||
{ | ||
Scenario.Define<Context>() | ||
.WithEndpoint<Sender>(b => b.Given(bus => bus.Send(new Message()))) | ||
.WithEndpoint<Receiver>() | ||
.Done(c => c.GetAllLogs().Any(l => l.Level == "error")) | ||
.Repeat(r => r.For(ScenarioDescriptors.Transports.Msmq)) | ||
.Should(c => | ||
{ | ||
var logs = c.GetAllLogs(); | ||
Assert.True(logs.Any(l => l.Message.Contains("is corrupt and will be moved to"))); | ||
}) | ||
.Run(); | ||
} | ||
|
||
public class Context : ScenarioContext | ||
{ | ||
} | ||
|
||
public class Sender : EndpointConfigurationBuilder | ||
{ | ||
public Sender() | ||
{ | ||
Configure.Transactions.Advanced(settings => settings.DisableDistributedTransactions()); | ||
EndpointSetup<DefaultServer>() | ||
.AddMapping<Message>(typeof(Receiver)); | ||
} | ||
} | ||
|
||
public class Receiver : EndpointConfigurationBuilder | ||
{ | ||
public Receiver() | ||
{ | ||
SerializerCorrupter.Corrupt(); | ||
Configure.Transactions.Advanced(settings => settings.DisableDistributedTransactions()); | ||
EndpointSetup<DefaultServer>() | ||
.AllowExceptions(); | ||
} | ||
} | ||
|
||
[Serializable] | ||
public class Message : IMessage | ||
{ | ||
} | ||
} | ||
} |
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
Oops, something went wrong.