From 51272aee22b83a657361e403165b0101d50d113d Mon Sep 17 00:00:00 2001 From: SzymonPobiega Date: Thu, 12 Mar 2015 10:46:31 +0100 Subject: [PATCH 1/3] Fixing the registry-based error queue name lookup Fixes #70 --- .../ErrorQueueSettingsTests.cs | 31 +++++++++++++++++++ .../NServiceBus.SqlServer.UnitTests.csproj | 1 + .../ErrorQueueSettings.cs | 4 +-- 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 src/NServiceBus.SqlServer.UnitTests/ErrorQueueSettingsTests.cs diff --git a/src/NServiceBus.SqlServer.UnitTests/ErrorQueueSettingsTests.cs b/src/NServiceBus.SqlServer.UnitTests/ErrorQueueSettingsTests.cs new file mode 100644 index 000000000..d61cc9f35 --- /dev/null +++ b/src/NServiceBus.SqlServer.UnitTests/ErrorQueueSettingsTests.cs @@ -0,0 +1,31 @@ +namespace NServiceBus.SqlServer.UnitTests +{ + using System; + using System.Collections.Generic; + using System.Configuration; + using NServiceBus.Config.ConfigurationSource; + using NServiceBus.Features; + using NServiceBus.Settings; + using NUnit.Framework; + + [TestFixture] + public class ErrorQueueSettingsTests + { + [Test] + public void It_can_try_to_obtain_the_error_queue_name_from_the_registry() + { + var settingsHolder = new SettingsHolder(); + settingsHolder.Set(new ConfigurationSource()); + settingsHolder.Set("TypesToScan", new List()); + Assert.Throws(() => ErrorQueueSettings.GetConfiguredErrorQueue(settingsHolder)); + } + + private class ConfigurationSource : IConfigurationSource + { + public T GetConfiguration() where T : class, new() + { + return null; + } + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.SqlServer.UnitTests/NServiceBus.SqlServer.UnitTests.csproj b/src/NServiceBus.SqlServer.UnitTests/NServiceBus.SqlServer.UnitTests.csproj index ac7cea985..7419e0297 100644 --- a/src/NServiceBus.SqlServer.UnitTests/NServiceBus.SqlServer.UnitTests.csproj +++ b/src/NServiceBus.SqlServer.UnitTests/NServiceBus.SqlServer.UnitTests.csproj @@ -56,6 +56,7 @@ + diff --git a/src/NServiceBus.SqlServer/ErrorQueueSettings.cs b/src/NServiceBus.SqlServer/ErrorQueueSettings.cs index 41af383b2..a51e8187e 100644 --- a/src/NServiceBus.SqlServer/ErrorQueueSettings.cs +++ b/src/NServiceBus.SqlServer/ErrorQueueSettings.cs @@ -30,8 +30,8 @@ public static Address GetConfiguredErrorQueue(ReadOnlySettings settings) } else { - var regRederType = Type.GetType("NServiceBus.Utils.RegistryReader, NServiceBus", true); - var readMethod = regRederType.GetMethod("Read", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public); + var regRederType = Type.GetType("NServiceBus.Utils.RegistryReader, NServiceBus.Core", true); + var readMethod = regRederType.GetMethod("Read", BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public); var registryErrorQueue = (string)readMethod.Invoke(null,new object[]{"ErrorQueue", null}); if (!string.IsNullOrWhiteSpace(registryErrorQueue)) { From c62ef4fd7effb7974b57bab06bb1d760a9279900 Mon Sep 17 00:00:00 2001 From: SzymonPobiega Date: Thu, 12 Mar 2015 10:53:47 +0100 Subject: [PATCH 2/3] Removed the no longer necessary octopus templates --- Octopus/DeploymentProcess.json | 88 ---------------------------------- Octopus/Project.json | 19 -------- 2 files changed, 107 deletions(-) delete mode 100644 Octopus/DeploymentProcess.json delete mode 100644 Octopus/Project.json diff --git a/Octopus/DeploymentProcess.json b/Octopus/DeploymentProcess.json deleted file mode 100644 index 503a70e49..000000000 --- a/Octopus/DeploymentProcess.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "Steps": [ - { - "Id": "b3339d4f-563f-49ac-b759-554619554f9d", - "Name": "Deploy", - "RequiresPackagesToBeAcquired": false, - "Properties": { - "Octopus.Action.TargetRoles": "tentacle" - }, - "Condition": "Success", - "Actions": [ - { - "Id": "f57466ee-18c3-4f89-9aa9-153814528a44", - "Name": "Deploy", - "ActionType": "Octopus.TentaclePackage", - "Environments": [], - "Properties": { - "Octopus.Action.Package.NuGetFeedId": "feeds-1", - "Octopus.Action.EnabledFeatures": "Octopus.Features.ConfigurationTransforms,Octopus.Features.ConfigurationVariables", - "Octopus.Action.Package.AutomaticallyRunConfigurationTransformationFiles": "False", - "Octopus.Action.Package.AutomaticallyUpdateAppSettingsAndConnectionStrings": "False", - "Octopus.Action.Package.DownloadOnTentacle": "False", - "Octopus.Action.Package.NuGetPackageId": "%PROJECT_NAME%.Deploy" - }, - "SensitiveProperties": {} - } - ], - "SensitiveProperties": {} - }, - { - "Id": "674e1a63-42cf-440e-83be-f80f58ef85a1", - "Name": "Notify of draft", - "RequiresPackagesToBeAcquired": false, - "Properties": { - "Octopus.Action.TargetRoles": "tentacle" - }, - "Condition": "Success", - "Actions": [ - { - "Id": "578efb8c-8303-4c1f-88a9-f3cee9e14e0a", - "Name": "Notify of draft", - "ActionType": "Octopus.Script", - "Environments": [ - "Environments-65" - ], - "Properties": { - "Octopus.Action.Script.ScriptBody": "$message = if ($OctopusParameters['HipChatMessage']) { $OctopusParameters['HipChatMessage'] } else { \"(successful) %PROJECT_NAME% [v$($OctopusParameters['Octopus.Release.Number'])] deployed to $($OctopusParameters['Octopus.Environment.Name']) on $($OctopusParameters['Octopus.Machine.Name'])\" } \n#---------\n$apitoken = $OctopusParameters['HipChatAuthToken']\n$roomid = $OctopusParameters['HipChatRoomId']\n$from = $OctopusParameters['HipChatFrom']\n$colour = $OctopusParameters['HipChatColor']\n\nTry \n{\n\t#Do the HTTP POST to HipChat\n\t$post = \"auth_token=$apitoken&room_id=$roomid&from=$from&color=$colour&message=$message¬ify=1&message_format=text\"\n\t$webRequest = [System.Net.WebRequest]::Create(\"https://api.hipchat.com/v1/rooms/message\")\n\t$webRequest.ContentType = \"application/x-www-form-urlencoded\"\n\t$postStr = [System.Text.Encoding]::UTF8.GetBytes($post)\n\t$webrequest.ContentLength = $postStr.Length\n\t$webRequest.Method = \"POST\"\n\t$requestStream = $webRequest.GetRequestStream()\n\t$requestStream.Write($postStr, 0,$postStr.length)\n\t$requestStream.Close()\n\t\n\t[System.Net.WebResponse] $resp = $webRequest.GetResponse();\n\t$rs = $resp.GetResponseStream();\n\t[System.IO.StreamReader] $sr = New-Object System.IO.StreamReader -argumentList $rs;\n\t$sr.ReadToEnd();\t\t\t\t\t\n}\ncatch [Exception] {\n\t\"Woah!, wasn't expecting to get this exception. `r`n $_.Exception.ToString()\"\n}", - "Octopus.Action.Template.Id": "ActionTemplates-2", - "Octopus.Action.Template.Version": "0", - "HipChatFrom": "Octopus Deploy", - "HipChatColor": "green", - "HipChatRoomId": "#{HipChatEngineeringID}", - "HipChatAuthToken": "#{HipChatAPIV1}", - "HipChatMessage": "New draft release of %PROJECT_NAME% at https://github.com/Particular/%PROJECT_NAME%/releases" - }, - "SensitiveProperties": {} - } - ], - "SensitiveProperties": {} - }, - { - "Id": "b6145394-b751-4d2e-8a92-1b82f1a3fc9a", - "Name": "Verify draft", - "RequiresPackagesToBeAcquired": false, - "Properties": { - "Octopus.Action.TargetRoles": "" - }, - "Condition": "Success", - "Actions": [ - { - "Id": "737fa883-457b-4821-805a-ade60e58e181", - "Name": "Verify draft", - "ActionType": "Octopus.Manual", - "Environments": [ - "Environments-65" - ], - "Properties": { - "Octopus.Action.Manual.ResponsibleTeamIds": "teams-everyone", - "Octopus.Action.Manual.Instructions": "Please verify the draft release notes of %PROJECT_NAME% at https://github.com/Particular/%PROJECT_NAME%/releases" - }, - "SensitiveProperties": {} - } - ], - "SensitiveProperties": {} - } - ], - "Version" : "%VERSION%" -} diff --git a/Octopus/Project.json b/Octopus/Project.json deleted file mode 100644 index 2108d757d..000000000 --- a/Octopus/Project.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "IncludedLibraryVariableSetIds": [ - "LibraryVariableSets-33", - "LibraryVariableSets-36", - "LibraryVariableSets-35", - "LibraryVariableSets-65", - "LibraryVariableSets-67" - ], - "DefaultToSkipIfAlreadyInstalled": false, - "VersioningStrategy": { - "DonorPackageStepId": null, - "Template": "#{Octopus.Version.LastMajor}.#{Octopus.Version.LastMinor}.#{Octopus.Version.NextPatch}" - }, - "Name": "%OCTO_PROJECT_NAME%", - "Description": "", - "IsDisabled": false, - "ProjectGroupId": "ProjectGroups-99", - "LifecycleId": "lifecycle-ProjectGroups-99", -} From 188c3075cd5e4e516595a436b44a4ae515ab830e Mon Sep 17 00:00:00 2001 From: SzymonPobiega Date: Thu, 12 Mar 2015 11:28:51 +0100 Subject: [PATCH 3/3] Removed old build deps. Upgraded NGP --- src/.nuget/packages.config | 6 ------ src/NServiceBus.SqlServer.sln | 3 --- src/NServiceBus.SqlServer/NServiceBus.SqlServer.csproj | 6 +++--- src/NServiceBus.SqlServer/packages.config | 2 +- 4 files changed, 4 insertions(+), 13 deletions(-) delete mode 100644 src/.nuget/packages.config diff --git a/src/.nuget/packages.config b/src/.nuget/packages.config deleted file mode 100644 index 1610affb5..000000000 --- a/src/.nuget/packages.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/NServiceBus.SqlServer.sln b/src/NServiceBus.SqlServer.sln index 1cabdd5a5..93a4230e5 100644 --- a/src/NServiceBus.SqlServer.sln +++ b/src/NServiceBus.SqlServer.sln @@ -14,9 +14,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{5EC71DFE-E04B-423C-8DCA-B43AD01F802E}" - ProjectSection(SolutionItems) = preProject - .nuget\packages.config = .nuget\packages.config - EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.SqlServer.UnitTests", "NServiceBus.SqlServer.UnitTests\NServiceBus.SqlServer.UnitTests.csproj", "{E7F3CFFC-9577-4868-AB8B-D839C02786EA}" EndProject diff --git a/src/NServiceBus.SqlServer/NServiceBus.SqlServer.csproj b/src/NServiceBus.SqlServer/NServiceBus.SqlServer.csproj index 8aa3593db..1029f20cd 100644 --- a/src/NServiceBus.SqlServer/NServiceBus.SqlServer.csproj +++ b/src/NServiceBus.SqlServer/NServiceBus.SqlServer.csproj @@ -15,7 +15,7 @@ $(SolutionDir)NServiceBus.snk ..\ - 89d13314 + 3ead7d6a true @@ -136,9 +136,9 @@ This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + - + \ No newline at end of file diff --git a/src/NServiceBus.SqlServer/packages.config b/src/NServiceBus.SqlServer/packages.config index 227bb44d5..acae12b57 100644 --- a/src/NServiceBus.SqlServer/packages.config +++ b/src/NServiceBus.SqlServer/packages.config @@ -4,5 +4,5 @@ - + \ No newline at end of file