-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #202 from Particular/release-2.2
Release 2.2
- Loading branch information
Showing
18 changed files
with
215 additions
and
79 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
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
57 changes: 57 additions & 0 deletions
57
src/AcceptanceTestsHolder/App_Packages/NoPersistenceServer.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.EndpointTemplates | ||
{ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
using AcceptanceTesting.Customization; | ||
using AcceptanceTesting.Support; | ||
using Configuration.AdvanceExtensibility; | ||
using Features; | ||
using Config.ConfigurationSource; | ||
|
||
public class NoPersistenceServer : IEndpointSetupTemplate | ||
{ | ||
public NoPersistenceServer() | ||
{ | ||
typesToInclude = new List<Type>(); | ||
} | ||
|
||
public NoPersistenceServer(List<Type> typesToInclude) | ||
{ | ||
this.typesToInclude = typesToInclude; | ||
} | ||
|
||
#pragma warning disable CS0618 | ||
public async Task<EndpointConfiguration> GetConfiguration(RunDescriptor runDescriptor, EndpointCustomizationConfiguration endpointConfiguration, IConfigurationSource configSource, Action<EndpointConfiguration> configurationBuilderCustomization) | ||
#pragma warning restore CS0618 | ||
{ | ||
var types = endpointConfiguration.GetTypesScopedByTestClass(); | ||
|
||
typesToInclude.AddRange(types); | ||
|
||
var configuration = new EndpointConfiguration(endpointConfiguration.EndpointName); | ||
|
||
configuration.TypesToIncludeInScan(typesToInclude); | ||
configuration.CustomConfigurationSource(configSource); | ||
configuration.EnableInstallers(); | ||
|
||
configuration.DisableFeature<TimeoutManager>(); | ||
|
||
var recoverability = configuration.Recoverability(); | ||
recoverability.Delayed(delayed => delayed.NumberOfRetries(0)); | ||
recoverability.Immediate(immediate => immediate.NumberOfRetries(0)); | ||
configuration.SendFailedMessagesTo("error"); | ||
|
||
await configuration.DefineTransport(runDescriptor, endpointConfiguration).ConfigureAwait(false); | ||
|
||
configuration.RegisterComponentsAndInheritanceHierarchy(runDescriptor); | ||
|
||
configuration.GetSettings().SetDefault("ScaleOut.UseSingleBrokerQueue", true); | ||
configurationBuilderCustomization(configuration); | ||
|
||
return configuration; | ||
} | ||
|
||
List<Type> typesToInclude; | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
src/AcceptanceTestsHolder/App_Packages/When_using_different_persistence.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,42 @@ | ||
using System.Threading.Tasks; | ||
using NServiceBus; | ||
using NServiceBus.AcceptanceTesting; | ||
using NServiceBus.AcceptanceTests; | ||
using NServiceBus.AcceptanceTests.EndpointTemplates; | ||
using NUnit.Framework; | ||
|
||
[TestFixture] | ||
public class When_using_different_persistence : NServiceBusAcceptanceTest | ||
{ | ||
[Test] | ||
public async Task Should_not_execute_installers() | ||
{ | ||
// The EndpointsStarted flag is set by acceptance framework | ||
var context = await Scenario.Define<Context>() | ||
.WithEndpoint<InMemoryPersistenceEndpoint>() | ||
.Done(c => c.EndpointsStarted) | ||
.Run() | ||
.ConfigureAwait(false); | ||
|
||
// If installers were run, we'd get an System.Exception: "ConnectionBuilder must be defined." | ||
Assert.True(context.EndpointsStarted); | ||
} | ||
|
||
public class Context : ScenarioContext | ||
{ | ||
} | ||
|
||
public class InMemoryPersistenceEndpoint : EndpointConfigurationBuilder | ||
{ | ||
public InMemoryPersistenceEndpoint() | ||
{ | ||
EndpointSetup<NoPersistenceServer>(c => c.UsePersistence<InMemoryPersistence>()); | ||
} | ||
} | ||
|
||
public class StartSagaMessage : IMessage | ||
{ | ||
public string Property { get; set; } | ||
} | ||
|
||
} |
8 changes: 5 additions & 3 deletions
8
src/MySqlAcceptanceTests/TestPartials/When_correlating_on_special_characters.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 |
---|---|---|
@@ -1,9 +1,11 @@ | ||
namespace NServiceBus.AcceptanceTests.Sagas | ||
{ | ||
#if RELEASE | ||
using NUnit.Framework; | ||
|
||
[Category("MySqlUnicode")] | ||
// So this test does not run on CI as server install does not support unicode | ||
[Explicit("MySqlUnicode")] | ||
#endif | ||
partial class When_correlating_special_chars | ||
{ | ||
} | ||
} | ||
} |
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
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,24 @@ | ||
using NServiceBus; | ||
using NServiceBus.Features; | ||
|
||
class InstallerFeature : Feature | ||
{ | ||
public InstallerFeature() | ||
{ | ||
Defaults(s => s.SetDefault<InstallerSettings>(new InstallerSettings())); | ||
} | ||
|
||
protected override void Setup(FeatureConfigurationContext context) | ||
{ | ||
var settings = context.Settings.Get<InstallerSettings>(); | ||
if (settings.Disabled) | ||
{ | ||
return; | ||
} | ||
|
||
settings.ConnectionBuilder = context.Settings.GetConnectionBuilder(); | ||
settings.SqlVariant = context.Settings.GetSqlVariant(); | ||
settings.ScriptDirectory = ScriptLocation.FindScriptDirectory(context.Settings); | ||
settings.TablePrefix = context.Settings.GetTablePrefix(); | ||
} | ||
} |
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,12 @@ | ||
using System; | ||
using System.Data.Common; | ||
using NServiceBus.Persistence.Sql; | ||
|
||
class InstallerSettings | ||
{ | ||
public bool Disabled { get; set; } | ||
public Func<DbConnection> ConnectionBuilder { get; set; } | ||
public SqlVariant SqlVariant { get; set; } | ||
public string ScriptDirectory { get; set; } | ||
public string TablePrefix { get; set; } | ||
} |
Oops, something went wrong.