-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
64 changed files
with
6,176 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# Auto detect text files and perform CRLF normalization | ||
* text=auto eol=crlf | ||
|
||
# Standard to msysgit | ||
*.doc diff=astextplain | ||
*.DOC diff=astextplain | ||
*.docx diff=astextplain | ||
*.DOCX diff=astextplain | ||
*.dot diff=astextplain | ||
*.DOT diff=astextplain | ||
*.pdf diff=astextplain | ||
*.PDF diff=astextplain | ||
*.rtf diff=astextplain | ||
*.RTF diff=astextplain | ||
|
||
*.exe -text -diff | ||
*.jpg -text -diff | ||
*.png -text -diff | ||
*.gif -text -diff | ||
*.dll -text -diff | ||
*.pdb -text -diff | ||
*.pptx -text -diff | ||
*.xap -text -diff | ||
*.ico -text -diff | ||
*.ttf -text -diff | ||
*.otf -text -diff | ||
|
||
*.cs text diff=csharp | ||
*.config text diff=csharp | ||
*.xml text diff=csharp | ||
*.vb text | ||
*.c text | ||
*.cpp text | ||
*.cxx text | ||
*.h text | ||
*.hxx text | ||
*.py text | ||
*.rb text | ||
*.java text | ||
*.html text | ||
*.htm text | ||
*.css text | ||
*.scss text | ||
*.sass text | ||
*.less text | ||
*.js text | ||
*.lisp text | ||
*.clj text | ||
*.sql text | ||
*.php text | ||
*.lua text | ||
*.m text | ||
*.asm text | ||
*.erl text | ||
*.fs text | ||
*.fsx text | ||
*.hs text | ||
*.targets text | ||
*.psm1 text | ||
*.ps1 text | ||
*.md text | ||
*.DotSettings text | ||
*.txt text eol=crlf | ||
*.bat text eol=crlf | ||
|
||
# Custom for Visual Studio | ||
*.csproj merge=union | ||
*.vbproj merge=union | ||
*.fsproj merge=union | ||
*.dbproj merge=union | ||
*.sln text eol=crlf merge=union | ||
*.suo -text -diff | ||
*.snk -text -diff | ||
*.cub -text -diff | ||
*.wixlib -text -diff |
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,92 @@ | ||
nugets | ||
deploy | ||
build32 | ||
binaries | ||
*.vshost.* | ||
.nu | ||
_UpgradeReport.* | ||
*.cache | ||
*~ | ||
*.swp | ||
results | ||
CommonAssemblyInfo.cs | ||
lib/sqlite/System.Data.SQLite.dll | ||
*.orig | ||
*.zip | ||
Samples/DataBus/storage | ||
packages | ||
PrecompiledWeb | ||
tempstorage | ||
core-only | ||
Release | ||
Artifacts | ||
LogFiles | ||
csx | ||
*.ncrunchproject | ||
*.ncrunchsolution | ||
_NCrunch_NServiceBus/* | ||
logs | ||
run-git.cmd | ||
src/Chocolatey/Build/* | ||
|
||
installer/[F|f]iles | ||
installer/[C|c]ustom[A|a]ctions | ||
installer/ServiceControl-cache | ||
|
||
# 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 | ||
*.json.lock | ||
*.userosscache | ||
*.sln.docstates | ||
.vs/ | ||
|
||
# mac temp file ignore | ||
.DS_Store | ||
|
||
# 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 | ||
|
||
src/scaffolding.config | ||
|
||
# Approval tests temp file | ||
*.received.* | ||
|
||
# JetBrains Rider | ||
.idea/ | ||
*.sln.iml |
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,6 @@ | ||
assembly-versioning-scheme: Major | ||
next-version: 1.0.0 | ||
commit-message-incrementing: Disabled | ||
branches: | ||
develop: | ||
tag: alpha |
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,10 @@ | ||
By accessing NServiceBus code here, you are agreeing to the following licensing terms. | ||
If you do not agree to these terms, do not access the NServiceBus code. | ||
|
||
Your license to the NServiceBus source and/or binaries is governed by the Reciprocal Public License 1.5 (RPL1.5) license as described here: | ||
|
||
http://www.opensource.org/licenses/rpl1.5.txt | ||
|
||
If you do not wish to release the source of software you build using NServiceBus, you may use NServiceBus source and/or binaries under the License Agreement described here: | ||
|
||
http://particular.net/LicenseAgreement |
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,2 +1,8 @@ | ||
# NServiceBus.Encryption.MessageProperty | ||
Provides encryption for properties on messages | ||
|
||
## Licensing | ||
|
||
### RijndaelEncryptionService | ||
|
||
Taken from [rhino-esb](https://github.com/hibernating-rhinos/rhino-esb/blob/master/Rhino.ServiceBus/Impl/RijndaelEncryptionService.cs) under [this license](https://github.com/hibernating-rhinos/rhino-esb/blob/master/license.txt) |
23 changes: 23 additions & 0 deletions
23
packaging/nuget/NServiceBus.Encryption.MessageProperty.nuspec
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,23 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<package xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> | ||
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> | ||
<id>NServiceBus.Encryption.MessageProperty</id> | ||
<title>NServiceBus Message Property Encryption</title> | ||
<version>$version$</version> | ||
<authors>$authors$</authors> | ||
<owners>$owners$</owners> | ||
<licenseUrl>$licenseUrl$</licenseUrl> | ||
<projectUrl>$projectUrl$</projectUrl> | ||
<iconUrl>$iconUrl$</iconUrl> | ||
<requireLicenseAcceptance>$requireLicenseAcceptance$</requireLicenseAcceptance> | ||
<description>Selectively encrypt NServiceBus message properties</description> | ||
<copyright>$copyright$</copyright> | ||
<tags>$tags$</tags> | ||
<dependencies> | ||
<dependency id="NServiceBus" version="[6.0.0, 7.0.0)" /> | ||
</dependencies> | ||
</metadata> | ||
<files> | ||
<file src="..\..\binaries\NServiceBus.Encryption.MessageProperty.???" target="lib\net452" /> | ||
</files> | ||
</package> |
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,73 @@ | ||
namespace NServiceBus.Encryption.MessageProperty.AcceptanceTests | ||
{ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
using AcceptanceTesting.Customization; | ||
using AcceptanceTesting.Support; | ||
using Config.ConfigurationSource; | ||
using Configuration.AdvanceExtensibility; | ||
using Features; | ||
|
||
public class DefaultServer : IEndpointSetupTemplate | ||
{ | ||
public DefaultServer() | ||
{ | ||
typesToInclude = new List<Type>(); | ||
} | ||
|
||
public DefaultServer(List<Type> typesToInclude) | ||
{ | ||
this.typesToInclude = typesToInclude; | ||
} | ||
|
||
public Task<EndpointConfiguration> GetConfiguration(RunDescriptor runDescriptor, EndpointCustomizationConfiguration endpointConfiguration, IConfigurationSource configSource, Action<EndpointConfiguration> configurationBuilderCustomization) | ||
{ | ||
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)); | ||
|
||
var transportConfig = configuration.UseTransport<MsmqTransport>(); | ||
var routingConfig = transportConfig.Routing(); | ||
|
||
foreach (var publisher in endpointConfiguration.PublisherMetadata.Publishers) | ||
{ | ||
foreach (var eventType in publisher.Events) | ||
{ | ||
routingConfig.RegisterPublisher(eventType, publisher.PublisherName); | ||
} | ||
} | ||
|
||
configuration.RegisterComponents(r => | ||
{ | ||
var type = runDescriptor.ScenarioContext.GetType(); | ||
while (type != typeof(object)) | ||
{ | ||
r.RegisterSingleton(type, runDescriptor.ScenarioContext); | ||
type = type.BaseType; | ||
} | ||
}); | ||
|
||
configuration.UsePersistence<InMemoryPersistence>(); | ||
|
||
configuration.GetSettings().SetDefault("ScaleOut.UseSingleBrokerQueue", true); | ||
configurationBuilderCustomization(configuration); | ||
|
||
return Task.FromResult(configuration); | ||
} | ||
|
||
List<Type> typesToInclude; | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
src/AcceptanceTests/Infrastructure/EndpointCustomizationConfigurationExtensions.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,53 @@ | ||
namespace NServiceBus.Encryption.MessageProperty.AcceptanceTests | ||
{ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Reflection; | ||
using AcceptanceTesting.Support; | ||
using Hosting.Helpers; | ||
|
||
public static class EndpointCustomizationConfigurationExtensions | ||
{ | ||
public static IEnumerable<Type> GetTypesScopedByTestClass(this EndpointCustomizationConfiguration endpointConfiguration) | ||
{ | ||
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"); | ||
}) | ||
.SelectMany(a => a.GetTypes()); | ||
|
||
types = types.Union(GetNestedTypeRecursive(endpointConfiguration.BuilderType.DeclaringType, endpointConfiguration.BuilderType)); | ||
|
||
types = types.Union(endpointConfiguration.TypesToInclude); | ||
|
||
return types.Where(t => !endpointConfiguration.TypesToExclude.Contains(t)).ToList(); | ||
} | ||
|
||
static IEnumerable<Type> GetNestedTypeRecursive(Type rootType, Type builderType) | ||
{ | ||
if (rootType == null) | ||
{ | ||
throw new InvalidOperationException("Make sure you nest the endpoint infrastructure inside the TestFixture as nested classes"); | ||
} | ||
|
||
yield return rootType; | ||
|
||
if (typeof(IEndpointConfigurationFactory).IsAssignableFrom(rootType) && rootType != builderType) | ||
{ | ||
yield break; | ||
} | ||
|
||
foreach (var nestedType in rootType.GetNestedTypes(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic).SelectMany(t => GetNestedTypeRecursive(t, builderType))) | ||
{ | ||
yield return nestedType; | ||
} | ||
} | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
src/AcceptanceTests/Infrastructure/NServiceBusAcceptanceTest.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,36 @@ | ||
namespace NServiceBus.Encryption.MessageProperty.AcceptanceTests | ||
{ | ||
using System.Linq; | ||
using System.Threading; | ||
using AcceptanceTesting.Customization; | ||
using NUnit.Framework; | ||
|
||
/// <summary> | ||
/// Base class for all the NSB test that sets up our conventions | ||
/// </summary> | ||
[TestFixture] | ||
// ReSharper disable once PartialTypeWithSinglePart | ||
public abstract partial class NServiceBusAcceptanceTest | ||
{ | ||
[SetUp] | ||
public void SetUp() | ||
{ | ||
Conventions.EndpointNamingConvention = t => | ||
{ | ||
var classAndEndpoint = t.FullName.Split('.').Last(); | ||
|
||
var testName = classAndEndpoint.Split('+').First(); | ||
|
||
testName = testName.Replace("When_", ""); | ||
|
||
var endpointBuilder = classAndEndpoint.Split('+').Last(); | ||
|
||
testName = Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(testName); | ||
|
||
testName = testName.Replace("_", ""); | ||
|
||
return testName + "." + endpointBuilder; | ||
}; | ||
} | ||
} | ||
} |
Oops, something went wrong.