diff --git a/GitVersion.yml b/GitVersion.yml index c3b6ceb..1e2838c 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -1,5 +1,5 @@ assembly-versioning-scheme: Major -next-version: 2.0 +next-version: 3.0 branches: develop: tag: alpha diff --git a/src/AcceptanceTests/EndpointTemplates/DefaultServer.cs b/src/AcceptanceTests/EndpointTemplates/DefaultServer.cs index 8746d2b..beba91f 100644 --- a/src/AcceptanceTests/EndpointTemplates/DefaultServer.cs +++ b/src/AcceptanceTests/EndpointTemplates/DefaultServer.cs @@ -5,9 +5,7 @@ using System.Threading.Tasks; using AcceptanceTesting.Customization; using AcceptanceTesting.Support; - using Configuration.AdvanceExtensibility; using Features; - using Config.ConfigurationSource; public class DefaultServer : IEndpointSetupTemplate { @@ -21,9 +19,7 @@ public DefaultServer(List typesToInclude) this.typesToInclude = typesToInclude; } -#pragma warning disable CS0618 - public async Task GetConfiguration(RunDescriptor runDescriptor, EndpointCustomizationConfiguration endpointConfiguration, IConfigurationSource configSource, Action configurationBuilderCustomization) -#pragma warning restore CS0618 + public async Task GetConfiguration(RunDescriptor runDescriptor, EndpointCustomizationConfiguration endpointConfiguration, Action configurationBuilderCustomization) { var types = endpointConfiguration.GetTypesScopedByTestClass(); @@ -32,7 +28,6 @@ public async Task GetConfiguration(RunDescriptor runDescr var configuration = new EndpointConfiguration(endpointConfiguration.EndpointName); configuration.TypesToIncludeInScan(typesToInclude); - configuration.CustomConfigurationSource(configSource); configuration.EnableInstallers(); configuration.DisableFeature(); @@ -48,7 +43,6 @@ public async Task GetConfiguration(RunDescriptor runDescr await configuration.DefinePersistence(runDescriptor, endpointConfiguration).ConfigureAwait(false); - configuration.GetSettings().SetDefault("ScaleOut.UseSingleBrokerQueue", true); configurationBuilderCustomization(configuration); return configuration; diff --git a/src/AcceptanceTests/EndpointTemplates/EndpointConfigurationExtensions.cs b/src/AcceptanceTests/EndpointTemplates/EndpointConfigurationExtensions.cs index eba7cd7..f07a96e 100644 --- a/src/AcceptanceTests/EndpointTemplates/EndpointConfigurationExtensions.cs +++ b/src/AcceptanceTests/EndpointTemplates/EndpointConfigurationExtensions.cs @@ -1,6 +1,6 @@ namespace NServiceBus.AcceptanceTests { - using Configuration.AdvanceExtensibility; + using Configuration.AdvancedExtensibility; public static class EndpointConfigurationExtensions { diff --git a/src/AcceptanceTests/EndpointTemplates/EndpointCustomizationConfigurationExtensions.cs b/src/AcceptanceTests/EndpointTemplates/EndpointCustomizationConfigurationExtensions.cs index d105b36..2b81e9d 100644 --- a/src/AcceptanceTests/EndpointTemplates/EndpointCustomizationConfigurationExtensions.cs +++ b/src/AcceptanceTests/EndpointTemplates/EndpointCustomizationConfigurationExtensions.cs @@ -13,14 +13,10 @@ public static IEnumerable GetTypesScopedByTestClass(this EndpointCustomiza { var assemblies = new AssemblyScanner().GetScannableAssemblies(); - var types = assemblies.Assemblies - //exclude all test types by default - .Where(a => - { - var references = a.GetReferencedAssemblies(); - - return references.All(an => an.Name != "nunit.framework"); - }) + var assembliesToScan = assemblies.Assemblies + //exclude acceptance tests by default + .Where(a => a != Assembly.GetExecutingAssembly()).ToList(); + var types = assembliesToScan .SelectMany(a => a.GetTypes()); types = types.Union(GetNestedTypeRecursive(endpointConfiguration.BuilderType.DeclaringType, endpointConfiguration.BuilderType)); @@ -50,4 +46,4 @@ static IEnumerable GetNestedTypeRecursive(Type rootType, Type builderType) } } } -} +} \ No newline at end of file diff --git a/src/AcceptanceTests/NServiceBus.Recoverability.RetrySucessNotification.AcceptanceTests.csproj b/src/AcceptanceTests/NServiceBus.Recoverability.RetrySucessNotification.AcceptanceTests.csproj index c5b81a1..2bc4e7a 100644 --- a/src/AcceptanceTests/NServiceBus.Recoverability.RetrySucessNotification.AcceptanceTests.csproj +++ b/src/AcceptanceTests/NServiceBus.Recoverability.RetrySucessNotification.AcceptanceTests.csproj @@ -1,16 +1,17 @@  - net462 + net462;netcoreapp2.0 - - - + + + + - + \ No newline at end of file diff --git a/src/AcceptanceTests/When_Failed_Messages_Are_Successfully_Retried.cs b/src/AcceptanceTests/When_Failed_Messages_Are_Successfully_Retried.cs index 815a1f2..182bcfe 100644 --- a/src/AcceptanceTests/When_Failed_Messages_Are_Successfully_Retried.cs +++ b/src/AcceptanceTests/When_Failed_Messages_Are_Successfully_Retried.cs @@ -21,7 +21,7 @@ public async Task Should_notify_with_sc_uniqueid_header() .WithEndpoint() .WithEndpoint(b => b.CustomConfig(config => { - config.RetrySuccessNotifications().SendRetrySuccessNotificationsTo(FakeServiceControl.NotificationsSatellite.NotificationAddress); + config.RetrySuccessNotification().SendRetrySuccessNotificationsTo(FakeServiceControl.NotificationsSatellite.NotificationAddress); }) .When(s => { @@ -44,7 +44,7 @@ await Scenario.Define() .WithEndpoint() .WithEndpoint(b => b.CustomConfig(config => { - config.RetrySuccessNotifications().SendRetrySuccessNotificationsTo(FakeServiceControl.NotificationsSatellite.NotificationAddress); + config.RetrySuccessNotification().SendRetrySuccessNotificationsTo(FakeServiceControl.NotificationsSatellite.NotificationAddress); }) .When(s => { @@ -64,7 +64,7 @@ public async Task Should_not_notify_when_trigger_header_is_missing() .WithEndpoint() .WithEndpoint(b => b.CustomConfig(config => { - config.RetrySuccessNotifications().SendRetrySuccessNotificationsTo(FakeServiceControl.NotificationsSatellite.NotificationAddress); + config.RetrySuccessNotification().SendRetrySuccessNotificationsTo(FakeServiceControl.NotificationsSatellite.NotificationAddress); }) .When(s => s.SendLocal(new MessageToBeRetried()))) .Done(c => diff --git a/src/AcceptanceTests/When_notifications_are_misconfigured.cs b/src/AcceptanceTests/When_notifications_are_misconfigured.cs index 6b07244..4138907 100644 --- a/src/AcceptanceTests/When_notifications_are_misconfigured.cs +++ b/src/AcceptanceTests/When_notifications_are_misconfigured.cs @@ -16,7 +16,7 @@ public async Task Should_not_activate_when_both_audits_and_notifications_are_sen .WithEndpoint(b => b.CustomConfig(config => { config.AuditProcessedMessagesTo("audit"); - config.RetrySuccessNotifications().SendRetrySuccessNotificationsTo("audit"); + config.RetrySuccessNotification().SendRetrySuccessNotificationsTo("audit"); })) .Done(c => c.EndpointsStarted) .Run(); @@ -31,7 +31,7 @@ public async Task Should_not_activate_when_notification_address_is_whitespace() var context = await Scenario.Define() .WithEndpoint(b => b.CustomConfig(config => { - config.RetrySuccessNotifications().SendRetrySuccessNotificationsTo(" "); + config.RetrySuccessNotification().SendRetrySuccessNotificationsTo(" "); })) .Done(c => c.EndpointsStarted) .Run(); @@ -46,7 +46,7 @@ public async Task Should_not_activate_when_notification_address_is_null() var context = await Scenario.Define() .WithEndpoint(b => b.CustomConfig(config => { - config.RetrySuccessNotifications().SendRetrySuccessNotificationsTo(null); + config.RetrySuccessNotification().SendRetrySuccessNotificationsTo(null); })) .Done(c => c.EndpointsStarted) .Run(); diff --git a/src/RetrySuccessNotification/Config/ConfigureRetrySuccessNotification.cs b/src/RetrySuccessNotification/Config/ConfigureRetrySuccessNotification.cs index be00de2..a842739 100644 --- a/src/RetrySuccessNotification/Config/ConfigureRetrySuccessNotification.cs +++ b/src/RetrySuccessNotification/Config/ConfigureRetrySuccessNotification.cs @@ -1,7 +1,7 @@ namespace NServiceBus { - using Configuration.AdvanceExtensibility; - + using Configuration.AdvancedExtensibility; + /// /// Configuration options for Retry Success Notifications /// @@ -10,7 +10,7 @@ public static class ConfigureRetrySuccessNotification /// /// Access settings to configure Retry Success Notifications /// - public static RetrySuccessNotificationConfig RetrySuccessNotifications(this EndpointConfiguration config) + public static RetrySuccessNotificationConfig RetrySuccessNotification(this EndpointConfiguration config) { return new RetrySuccessNotificationConfig(config.GetSettings()); } diff --git a/src/RetrySuccessNotification/NServiceBus.Recoverability.RetrySucessNotification.csproj b/src/RetrySuccessNotification/NServiceBus.Recoverability.RetrySucessNotification.csproj index 70de23b..9eb8ed0 100644 --- a/src/RetrySuccessNotification/NServiceBus.Recoverability.RetrySucessNotification.csproj +++ b/src/RetrySuccessNotification/NServiceBus.Recoverability.RetrySucessNotification.csproj @@ -1,7 +1,7 @@  - net452 + net452;netstandard2.0 NServiceBus.Recoverability.RetrySuccessNotification NServiceBus.Recoverability.RetrySuccessNotification false @@ -24,9 +24,6 @@ - - - - + \ No newline at end of file diff --git a/src/RetrySuccessNotification/RetrySuccessNotification.cs b/src/RetrySuccessNotification/RetrySuccessNotification.cs index c3e54c2..ca43420 100644 --- a/src/RetrySuccessNotification/RetrySuccessNotification.cs +++ b/src/RetrySuccessNotification/RetrySuccessNotification.cs @@ -5,7 +5,7 @@ /// /// - /// Provides the retry success notification feature + /// Provides the retry success notification feature /// public class RetrySuccessNotification : Feature { diff --git a/src/RetrySuccessNotification/Transport/IncomingMessageExtensions.cs b/src/RetrySuccessNotification/Transport/IncomingMessageExtensions.cs deleted file mode 100644 index ae35e7e..0000000 --- a/src/RetrySuccessNotification/Transport/IncomingMessageExtensions.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace NServiceBus.Transport -{ - using System.Reflection; - - static class IncomingMessageExtensions - { - public static void RevertToOriginalBodyIfNeededUsingReflection(this IncomingMessage message) - { - var incomingMessageType = typeof(IncomingMessage); - var bindingFlags = BindingFlags.Instance | BindingFlags.NonPublic; - var methodInfo = incomingMessageType.GetMethod("RevertToOriginalBodyIfNeeded", bindingFlags); - methodInfo.Invoke(message, null); - } - } -} \ No newline at end of file diff --git a/src/RetrySuccessNotification/Utils/RegistryReader.cs b/src/RetrySuccessNotification/Utils/RegistryReader.cs deleted file mode 100644 index 918bc7d..0000000 --- a/src/RetrySuccessNotification/Utils/RegistryReader.cs +++ /dev/null @@ -1,46 +0,0 @@ -namespace NServiceBus.Utils -{ - using System; - using Logging; - using Microsoft.Win32; - - static class RegistryReader - { - static ILog Logger = LogManager.GetLogger(typeof(RegistryReader)); - - public static string Read(string name, string defaultValue = null) - { - try - { - return ReadRegistryKeyValue(name, defaultValue); - } - catch (Exception ex) - { - Logger.Warn($@"We couldn't read the registry to retrieve the {name}, from 'HKEY_LOCAL_MACHINE\SOFTWARE\ParticularSoftware\ServiceBus'.", ex); - } - - return defaultValue; - } - - static string ReadRegistryKeyValue(string keyName, string defaultValue) - { - if (Environment.Is64BitOperatingSystem) - { - return ReadRegistry(RegistryView.Registry32, keyName, defaultValue) ?? ReadRegistry(RegistryView.Registry64, keyName, defaultValue); - } - return ReadRegistry(RegistryView.Default, keyName, defaultValue); - } - - static string ReadRegistry(RegistryView view, string keyName, string defaultValue) - { - using (var key = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, view).OpenSubKey(@"SOFTWARE\ParticularSoftware\ServiceBus")) - { - if (key == null) - { - return defaultValue; - } - return (string)key.GetValue(keyName, defaultValue); - } - } - } -} \ No newline at end of file diff --git a/src/Tests/APIApprovals.Approve.approved.txt b/src/Tests/APIApprovals.Approve.approved.txt index 29f73db..8291a1d 100644 --- a/src/Tests/APIApprovals.Approve.approved.txt +++ b/src/Tests/APIApprovals.Approve.approved.txt @@ -5,7 +5,7 @@ namespace NServiceBus { public class static ConfigureRetrySuccessNotification { - public static NServiceBus.RetrySuccessNotificationConfig RetrySuccessNotifications(this NServiceBus.EndpointConfiguration config) { } + public static NServiceBus.RetrySuccessNotificationConfig RetrySuccessNotification(this NServiceBus.EndpointConfiguration config) { } } public class RetrySuccessNotificationConfig { diff --git a/src/Tests/Config/RetrySuccessNotificationConfigTests.cs b/src/Tests/Config/RetrySuccessNotificationConfigTests.cs index 340ec48..0b636ab 100644 --- a/src/Tests/Config/RetrySuccessNotificationConfigTests.cs +++ b/src/Tests/Config/RetrySuccessNotificationConfigTests.cs @@ -1,6 +1,6 @@ using System.Linq; using NServiceBus; -using NServiceBus.Configuration.AdvanceExtensibility; +using NServiceBus.Configuration.AdvancedExtensibility; using NServiceBus.Features; using NUnit.Framework; @@ -12,7 +12,7 @@ public void Notification_Address_Can_Be_Set() { var endpointConfiguration = new EndpointConfiguration("test"); - var config = endpointConfiguration.RetrySuccessNotifications(); + var config = endpointConfiguration.RetrySuccessNotification(); const string testAddress = "Test"; @@ -31,7 +31,7 @@ public void Trigger_Headers_Can_Be_Added() { var endpointConfiguration = new EndpointConfiguration("test"); - var config = endpointConfiguration.RetrySuccessNotifications(); + var config = endpointConfiguration.RetrySuccessNotification(); const string testHeader = "Test"; @@ -55,7 +55,7 @@ public void Copy_Message_Body_Setting_Can_Be_Set() { var endpointConfiguration = new EndpointConfiguration("test"); - var config = endpointConfiguration.RetrySuccessNotifications(); + var config = endpointConfiguration.RetrySuccessNotification(); config.CopyMessageBodyInNotification = true; diff --git a/src/Tests/NServiceBus.Recoverability.RetrySucessNotification.ComponentTests.csproj b/src/Tests/NServiceBus.Recoverability.RetrySucessNotification.ComponentTests.csproj index 3655f4a..feea57a 100644 --- a/src/Tests/NServiceBus.Recoverability.RetrySucessNotification.ComponentTests.csproj +++ b/src/Tests/NServiceBus.Recoverability.RetrySucessNotification.ComponentTests.csproj @@ -1,7 +1,7 @@  - net462 + net462;netcoreapp2.0 true $(SolutionDir)NServiceBus.snk full @@ -9,9 +9,16 @@ true + + + + + + + + + - -