forked from Particular/NServiceBus.RabbitMQ
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
92e4b8d
commit ae2f3d1
Showing
8 changed files
with
958 additions
and
0 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
src/NServiceBus.RabbitMQ.Tests/APIApprovals.Approve.approved.txt
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,43 @@ | ||
[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute(@"NServiceBus.Transports.RabbitMQ.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100dde965e6172e019ac82c2639ffe494dd2e7dd16347c34762a05732b492e110f2e4e2e1b5ef2d85c848ccfb671ee20a47c8d1376276708dc30a90ff1121b647ba3b7259a6bc383b2034938ef0e275b58b920375ac605076178123693c6c4f1331661a62eba28c249386855637780e3ff5f23a6d854700eaa6803ef48907513b92")] | ||
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)] | ||
[assembly: System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.5.2", FrameworkDisplayName=".NET Framework 4.5.2")] | ||
namespace NServiceBus | ||
{ | ||
public class RabbitMQTransport : NServiceBus.Transports.TransportDefinition | ||
{ | ||
public RabbitMQTransport() { } | ||
public override string ExampleConnectionStringForErrorMessage { get; } | ||
protected override NServiceBus.Transports.TransportInfrastructure Initialize(NServiceBus.Settings.SettingsHolder settings, string connectionString) { } | ||
} | ||
public class static RabbitMQTransportSettingsExtensions | ||
{ | ||
[System.ObsoleteAttribute("Replaced by NServiceBus.Callbacks package. Will be removed in version 5.0.0.", true)] | ||
public static NServiceBus.TransportExtensions<NServiceBus.RabbitMQTransport> CallbackReceiverMaxConcurrency(this NServiceBus.TransportExtensions<NServiceBus.RabbitMQTransport> transportExtensions, int maxConcurrency) { } | ||
public static NServiceBus.TransportExtensions<NServiceBus.RabbitMQTransport> CustomMessageIdStrategy(this NServiceBus.TransportExtensions<NServiceBus.RabbitMQTransport> transportExtensions, System.Func<RabbitMQ.Client.Events.BasicDeliverEventArgs, string> customIdStrategy) { } | ||
[System.ObsoleteAttribute("Replaced by NServiceBus.Callbacks package. Will be removed in version 5.0.0.", true)] | ||
public static NServiceBus.TransportExtensions<NServiceBus.RabbitMQTransport> DisableCallbackReceiver(this NServiceBus.TransportExtensions<NServiceBus.RabbitMQTransport> transportExtensions) { } | ||
public static NServiceBus.TransportExtensions<NServiceBus.RabbitMQTransport> TimeToWaitBeforeTriggeringCircuitBreaker(this NServiceBus.TransportExtensions<NServiceBus.RabbitMQTransport> transportExtensions, System.TimeSpan waitTime) { } | ||
[System.ObsoleteAttribute("Will be removed in version 5.0.0.", true)] | ||
public static NServiceBus.TransportExtensions<NServiceBus.RabbitMQTransport> UseConnectionManager<T>(this NServiceBus.TransportExtensions<NServiceBus.RabbitMQTransport> transportExtensions) { } | ||
public static NServiceBus.TransportExtensions<NServiceBus.RabbitMQTransport> UseDirectRoutingTopology(this NServiceBus.TransportExtensions<NServiceBus.RabbitMQTransport> transportExtensions, System.Func<System.Type, string> routingKeyConvention = null, System.Func<string, System.Type, string> exchangeNameConvention = null) { } | ||
public static NServiceBus.TransportExtensions<NServiceBus.RabbitMQTransport> UseRoutingTopology<T>(this NServiceBus.TransportExtensions<NServiceBus.RabbitMQTransport> transportExtensions) | ||
where T : NServiceBus.Transports.RabbitMQ.Routing.IRoutingTopology { } | ||
} | ||
} | ||
namespace NServiceBus.Transports.RabbitMQ | ||
{ | ||
[System.ObsoleteAttribute("Will be removed in version 5.0.0.", true)] | ||
public interface IManageRabbitMqConnections { } | ||
} | ||
namespace NServiceBus.Transports.RabbitMQ.Routing | ||
{ | ||
public interface IRoutingTopology | ||
{ | ||
void Initialize(RabbitMQ.Client.IModel channel, string main); | ||
void Publish(RabbitMQ.Client.IModel channel, System.Type type, NServiceBus.Transports.OutgoingMessage message, RabbitMQ.Client.IBasicProperties properties); | ||
void RawSendInCaseOfFailure(RabbitMQ.Client.IModel channel, string address, byte[] body, RabbitMQ.Client.IBasicProperties properties); | ||
void Send(RabbitMQ.Client.IModel channel, string address, NServiceBus.Transports.OutgoingMessage message, RabbitMQ.Client.IBasicProperties properties); | ||
void SetupSubscription(RabbitMQ.Client.IModel channel, System.Type type, string subscriberName); | ||
void TeardownSubscription(RabbitMQ.Client.IModel channel, System.Type type, string subscriberName); | ||
} | ||
} |
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,35 @@ | ||
using System; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Runtime.CompilerServices; | ||
using ApiApprover; | ||
using ApprovalTests; | ||
using Mono.Cecil; | ||
using NServiceBus; | ||
using NUnit.Framework; | ||
|
||
[TestFixture] | ||
public class APIApprovals | ||
{ | ||
[Test] | ||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
public void Approve() | ||
{ | ||
var assemblyPath = Path.GetFullPath(typeof(RabbitMQTransport).Assembly.Location); | ||
var asm = AssemblyDefinition.ReadAssembly(assemblyPath); | ||
var publicApi = Filter(PublicApiGenerator.CreatePublicApiForAssembly(asm)); | ||
Approvals.Verify(publicApi); | ||
} | ||
|
||
string Filter(string text) | ||
{ | ||
return string.Join(Environment.NewLine, text.Split(new[] | ||
{ | ||
Environment.NewLine | ||
}, StringSplitOptions.RemoveEmptyEntries) | ||
.Where(l => !l.StartsWith("[assembly: ReleaseDateAttribute(")) | ||
.Where(l => !string.IsNullOrWhiteSpace(l)) | ||
); | ||
} | ||
|
||
} |
43 changes: 43 additions & 0 deletions
43
src/NServiceBus.RabbitMQ.Tests/App_Packages/ApiApprover.3.0.1/PublicApiApprover.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,43 @@ | ||
using System.IO; | ||
using ApprovalTests; | ||
using ApprovalTests.Namers; | ||
using Mono.Cecil; | ||
|
||
namespace ApiApprover | ||
{ | ||
public static class PublicApiApprover | ||
{ | ||
public static void ApprovePublicApi(string assemblyPath) | ||
{ | ||
var assemblyResolver = new DefaultAssemblyResolver(); | ||
assemblyResolver.AddSearchDirectory(Path.GetDirectoryName(assemblyPath)); | ||
|
||
var readSymbols = File.Exists(Path.ChangeExtension(assemblyPath, ".pdb")); | ||
var asm = AssemblyDefinition.ReadAssembly(assemblyPath, new ReaderParameters(ReadingMode.Deferred) | ||
{ | ||
ReadSymbols = readSymbols, | ||
AssemblyResolver = assemblyResolver, | ||
}); | ||
|
||
var publicApi = PublicApiGenerator.CreatePublicApiForAssembly(asm); | ||
var writer = new ApprovalTextWriter(publicApi, "cs"); | ||
var approvalNamer = new AssemblyPathNamer(assemblyPath); | ||
ApprovalTests.Approvals.Verify(writer, approvalNamer, ApprovalTests.Approvals.GetReporter()); | ||
} | ||
|
||
private class AssemblyPathNamer : UnitTestFrameworkNamer | ||
{ | ||
private readonly string name; | ||
|
||
public AssemblyPathNamer(string assemblyPath) | ||
{ | ||
name = Path.GetFileNameWithoutExtension(assemblyPath); | ||
} | ||
|
||
public override string Name | ||
{ | ||
get { return name; } | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.