Skip to content

Commit

Permalink
Merge branch 'release-1.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Bielleman committed Feb 10, 2015
2 parents d8557a5 + a247976 commit 0478e42
Show file tree
Hide file tree
Showing 40 changed files with 1,197 additions and 331 deletions.
55 changes: 45 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
nugets
deploy
build32
binaries
obj
bin
*.vshost.*
.nu
_ReSharper.*
_UpgradeReport.*
*.csproj.user
*.resharper.user
*.resharper
*.suo
*.cache
*~
*.swp
*.user
TestResults
TestResult.xml
results
CommonAssemblyInfo.cs
lib/sqlite/System.Data.SQLite.dll
Expand All @@ -35,3 +26,47 @@ _NCrunch_NServiceBus/*
logs
run-git.cmd
src/Chocolatey/Build/*

# Created by https://www.gitignore.io

### VisualStudio ###
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
build/
bld/
[Bb]in/
[Oo]bj/

# Roslyn cache directories
*.ide/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

#NUNIT
*.VisualState.xml
TestResult.xml

# NCrunch
_NCrunch_*
.*crunch*.local.xml

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
200 changes: 45 additions & 155 deletions installer/ServiceControl.aip

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions src/Chocolatey/chocolateyInstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ else{
$url = "https://github.com/Particular/$packageName/releases/download/{{ReleaseName}}/Particular.$packageName-{{FileVersion}}.exe"
}


try {

$existngService = Get-Service -Name "Particular.Management" -ErrorAction SilentlyContinue
Expand All @@ -29,7 +28,7 @@ try {
}

Get-ChocolateyWebFile $packageName $file $url
$msiArguments ="/quiet /L*V `"$logFile`""
$msiArguments ="/quiet PlatformInstaller=true /L*V `"$logFile`""
Write-Host "Starting installer with arguments: $msiArguments";
Start-ChocolateyProcessAsAdmin "$msiArguments" $file -validExitCodes 0
Write-ChocolateySuccess $packageName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@
using Contexts;
using NServiceBus;
using NServiceBus.AcceptanceTesting;
using NServiceBus.Features;
using NServiceBus.Transports;
using NUnit.Framework;
using ServiceControl.CompositeViews.Messages;
using ServiceControl.MessageFailures.Api;

class Audit_Messages_Have_Proper_IsSytemMessage_Tests: AcceptanceTest
class Audit_Messages_Have_Proper_IsSystemMessage_Tests: AcceptanceTest
{
[Test]
public void Should_set_the_IsSystemMessage_when_message_type_is_not_a_scheduled_task()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
namespace ServiceBus.Management.AcceptanceTests.ExternalIntegrations
{
using System;
using Contexts;
using NServiceBus;
using NServiceBus.AcceptanceTesting;
using NServiceBus.Config;
using NServiceBus.Config.ConfigurationSource;
using NServiceBus.Features;
using NServiceBus.Unicast.Subscriptions;
using NServiceBus.Unicast.Subscriptions.MessageDrivenSubscriptions;
using NUnit.Framework;
using ServiceControl.Contracts;
using ServiceControl.Contracts.Operations;

[TestFixture]
public class When_a_message_has_custom_checks : AcceptanceTest
{
[Test]
public void Notification_should_be_published_on_the_bus()
{
var context = new MyContext();

Scenario.Define(context)
.WithEndpoint<ExternalIntegrationsManagementEndpoint>(b => b.Given((bus, c) => Subscriptions.OnEndpointSubscribed(s =>
{
if (s.SubscriberReturnAddress.Queue.Contains("ExternalProcessor"))
{
c.ExternalProcessorSubscribed = true;
}
}, () => c.ExternalProcessorSubscribed = true))
.When(c => c.ExternalProcessorSubscribed, bus =>
{
bus.Publish(new ServiceControl.Contracts.CustomChecks.CustomCheckSucceeded
{
Category = "Testing",
CustomCheckId = "Success custom check",
OriginatingEndpoint = new EndpointDetails
{
Host = "MyHost",
HostId = Guid.Empty,
Name = "Testing"
},
SucceededAt = DateTime.Now,
});
bus.Publish(new ServiceControl.Contracts.CustomChecks.CustomCheckFailed
{
Category = "Testing",
CustomCheckId = "Fail custom check",
OriginatingEndpoint = new EndpointDetails
{
Host = "MyHost",
HostId = Guid.Empty,
Name = "Testing"
},
FailedAt = DateTime.Now,
FailureReason = "Because I can",
});
}).AppConfig(PathToAppConfig))
.WithEndpoint<ExternalProcessor>(b => b.Given((bus, c) =>
{
bus.Subscribe<CustomCheckSucceeded>();
bus.Subscribe<CustomCheckFailed>();
}))
.Done(c => c.CustomCheckFailedReceived && c.CustomCheckFailedReceived)
.Run();

Assert.IsTrue(context.CustomCheckFailedReceived);
Assert.IsTrue(context.CustomCheckSucceededReceived);
}

[Serializable]
public class Subscriptions
{
public static Action<Action<SubscriptionEventArgs>, Action> OnEndpointSubscribed = (actionToPerformIfMessageDrivenSubscriptions, actionToPerformIfMessageDrivenSubscriptionsNotRequired) =>
{
if (Feature.IsEnabled<MessageDrivenSubscriptions>())
{
Configure.Instance.Builder.Build<MessageDrivenSubscriptionManager>().ClientSubscribed +=
(sender, args) =>
{
actionToPerformIfMessageDrivenSubscriptions(args);
};

return;
}

actionToPerformIfMessageDrivenSubscriptionsNotRequired();
};
}

public class ExternalIntegrationsManagementEndpoint : EndpointConfigurationBuilder
{
public ExternalIntegrationsManagementEndpoint()
{
EndpointSetup<ExternalIntegrationsManagementEndpointSetup>();
}
}

public class ExternalProcessor : EndpointConfigurationBuilder
{
public ExternalProcessor()
{
EndpointSetup<JSonServer>();
}

public class CustomCheckSucceededHandler : IHandleMessages<CustomCheckSucceeded>
{
public MyContext Context { get; set; }

public void Handle(CustomCheckSucceeded message)
{
Context.CustomCheckSucceededReceived = true;
}
}

public class CustomCheckFailedHandler : IHandleMessages<CustomCheckFailed>
{
public MyContext Context { get; set; }

public void Handle(CustomCheckFailed message)
{
Context.CustomCheckFailedReceived = true;
}
}

public class UnicastOverride : IProvideConfiguration<UnicastBusConfig>
{
public UnicastBusConfig GetConfiguration()
{
var config = new UnicastBusConfig();
var serviceControlMapping = new MessageEndpointMapping
{
Messages = "ServiceControl.Contracts",
Endpoint = "Particular.ServiceControl"
};
config.MessageEndpointMappings.Add(serviceControlMapping);
return config;
}
}
}

public class MyContext : ScenarioContext
{
public bool CustomCheckSucceededReceived { get; set; }
public bool CustomCheckFailedReceived { get; set; }
public bool ExternalProcessorSubscribed { get; set; }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
</Reference>
<Reference Include="ServiceControl.Contracts, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\ServiceControl.Contracts.1.0.0\lib\net45\ServiceControl.Contracts.dll</HintPath>
<HintPath>..\packages\ServiceControl.Contracts.1.1.0\lib\net45\ServiceControl.Contracts.dll</HintPath>
</Reference>
<Reference Include="ServiceControl.Plugin.Nsb4.CustomChecks, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down Expand Up @@ -167,7 +167,7 @@
<Reference Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
<Compile Include="Audit\Audit_Messages_Have_Proper_IsSytemMessage_Tests.cs" />
<Compile Include="Audit\Audit_Messages_Have_Proper_IsSystemMessage_Tests.cs" />
<Compile Include="Contexts\ExternalIntegrationsManagementEndpointSetup.cs" />
<Compile Include="Contexts\TransportIntegration\ActiveMqTransportIntegration.cs" />
<Compile Include="Contexts\TransportIntegration\AzureStorageQueuesTransportIntegration.cs" />
Expand All @@ -180,7 +180,8 @@
<Compile Include="CustomChecks\When_a_custom_check_fails.cs" />
<Compile Include="CustomChecks\When_a_periodic_custom_check_fails.cs" />
<Compile Include="DebugSessions\When_an_endpoint_is_running_with_debug_sessions_enabled.cs" />
<Compile Include="ExternalIntegrations\JSonServer.cs" />
<Compile Include="ExternalIntegrations\JsonServer.cs" />
<Compile Include="ExternalIntegrations\When_a_message_has_custom_checks.cs" />
<Compile Include="ExternalIntegrations\When_a_message_has_failed.cs" />
<Compile Include="ExternalIntegrations\When_heartbeat_is_restored.cs" />
<Compile Include="ExternalIntegrations\When_encountered_an_error.cs" />
Expand Down
2 changes: 1 addition & 1 deletion src/ServiceControl.AcceptanceTests/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<package id="NUnit" version="2.6.2" targetFramework="net45" />
<package id="RabbitMQ.Client" version="3.2.1" targetFramework="net45" />
<package id="RavenDB.Client" version="2.5.2916" targetFramework="net45" />
<package id="ServiceControl.Contracts" version="1.0.0" targetFramework="net45" />
<package id="ServiceControl.Contracts" version="1.1.0" targetFramework="net45" />
<package id="ServiceControl.Plugin.Nsb4.CustomChecks" version="1.0.0" targetFramework="net45" />
<package id="ServiceControl.Plugin.Nsb4.DebugSession" version="1.0.0" targetFramework="net45" />
<package id="ServiceControl.Plugin.Nsb4.Heartbeat" version="1.0.0" targetFramework="net45" />
Expand Down
Loading

0 comments on commit 0478e42

Please sign in to comment.