Skip to content

Commit

Permalink
updarting core and nhibernate to rtm (#316)
Browse files Browse the repository at this point in the history
* updarting core and nhibernate to rtm

* fixing broken ATT
  • Loading branch information
tmasternak authored and Marcin Hoppe committed Oct 11, 2016
1 parent d75fb52 commit 4d0ec56
Show file tree
Hide file tree
Showing 272 changed files with 786 additions and 435 deletions.
2 changes: 1 addition & 1 deletion packaging/nuget/NServiceBus.SqlServer.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<releaseNotes></releaseNotes>
<tags>$tags$</tags>
<dependencies>
<dependency id="NServiceBus" version="[6.0.0-rc0001, 7.0.0)" />
<dependency id="NServiceBus" version="[6.0.0, 7.0.0)" />
</dependencies>
</metadata>
<files>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ public Task Handle(SendMessage message, IMessageHandlerContext context)
}
}

public class TestingSendOptionsExtensionBehavior : Behavior<IOutgoingLogicalMessageContext>
public class TestingSendOptionsExtensionBehavior : IBehavior<IOutgoingLogicalMessageContext, IOutgoingLogicalMessageContext>
{
public override Task Invoke(IOutgoingLogicalMessageContext context, Func<Task> next)
public Task Invoke(IOutgoingLogicalMessageContext context, Func<IOutgoingLogicalMessageContext, Task> next)
{
Context data;
if (context.Extensions.TryGet(out data))
Expand All @@ -70,7 +70,7 @@ public override Task Invoke(IOutgoingLogicalMessageContext context, Func<Task> n
});
}

return next();
return next(context);
}

public class Context
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ public Publisher()
});
}

public class PublishExtensionBehavior : Behavior<IOutgoingLogicalMessageContext>
public class PublishExtensionBehavior : IBehavior<IOutgoingLogicalMessageContext, IOutgoingLogicalMessageContext>
{
public override Task Invoke(IOutgoingLogicalMessageContext context, Func<Task> next)
public Task Invoke(IOutgoingLogicalMessageContext context, Func<IOutgoingLogicalMessageContext, Task> next)
{
Context data;

Expand All @@ -78,7 +78,7 @@ public override Task Invoke(IOutgoingLogicalMessageContext context, Func<Task> n
Assert.Fail("Expected to find the data");
}

return next();
return next(context);
}

public class Context
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ public Task Handle(SomeMessage message, IMessageHandlerContext context)
}
}

class CustomContextExtensionBehavior : Behavior<IIncomingLogicalMessageContext>
class CustomContextExtensionBehavior : IBehavior<IIncomingLogicalMessageContext, IIncomingLogicalMessageContext>
{
public override Task Invoke(IIncomingLogicalMessageContext context, Func<Task> next)
public Task Invoke(IIncomingLogicalMessageContext context, Func<IIncomingLogicalMessageContext, Task> next)
{
context.Extensions.Set("CustomExtension", ExtensionValue);
return next();
return next(context);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,20 +133,20 @@ public Task<TimeoutsChunk> GetNextChunk(DateTime startSlice)
TimeoutData timeoutData;
}

class BehaviorThatLogsControlMessageDelivery : Behavior<ITransportReceiveContext>
class BehaviorThatLogsControlMessageDelivery : IBehavior<ITransportReceiveContext, ITransportReceiveContext>
{
public Context TestContext { get; set; }

public override async Task Invoke(ITransportReceiveContext context, Func<Task> next)
public Task Invoke(ITransportReceiveContext context, Func<ITransportReceiveContext, Task> next)
{
if (context.Message.Headers.ContainsKey(Headers.ControlMessageHeader) &&
context.Message.Headers["Timeout.Id"] == TestContext.TestRunId.ToString())
{
TestContext.FailedTimeoutMovedToError = true;
return;
return Task.FromResult(0);
}

await next().ConfigureAwait(false);
return next(context);
}

public class Registration : RegisterStep
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,20 +135,20 @@ public Task<TimeoutsChunk> GetNextChunk(DateTime startSlice)
TimeoutData timeoutData;
}

class BehaviorThatLogsControlMessageDelivery : Behavior<ITransportReceiveContext>
class BehaviorThatLogsControlMessageDelivery : IBehavior<ITransportReceiveContext, ITransportReceiveContext>
{
public Context TestContext { get; set; }

public override async Task Invoke(ITransportReceiveContext context, Func<Task> next)
public Task Invoke(ITransportReceiveContext context, Func<ITransportReceiveContext, Task> next)
{
if (context.Message.Headers.ContainsKey(Headers.ControlMessageHeader) &&
context.Message.Headers["Timeout.Id"] == TestContext.TestRunId.ToString())
{
TestContext.FailedTimeoutMovedToError = true;
return;
return Task.FromResult(0);
}

await next().ConfigureAwait(false);
return next(context);
}

public class Registration : RegisterStep
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
namespace NServiceBus.AcceptanceTests.DelayedDelivery
{
using System;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.Customization;
using EndpointTemplates;
using Features;
using NServiceBus.Config;
using NUnit.Framework;
using ScenarioDescriptors;

public class When_using_external_timeout_manager : NServiceBusAcceptanceTest
{
[Test]
public async Task Should_delay_delivery()
{
await Scenario.Define<Context>()
.WithEndpoint<EndpointWithTimeoutManager>()
.WithEndpoint<Endpoint>(b => b.When((session, c) =>
{
var options = new SendOptions();

options.DelayDeliveryWith(TimeSpan.FromMilliseconds(2000));
options.RouteToThisEndpoint();

return session.Send(new MyMessage(), options);
}))
.Done(c => c.WasCalled)
.Repeat(r => r.For<AllTransportsWithoutNativeDeferral>())
.Should(c => { Assert.IsTrue(c.TimeoutManagerHeaderDetected); })
.Run();
}

public class Context : ScenarioContext
{
public bool TimeoutManagerHeaderDetected { get; set; }
public bool WasCalled { get; set; }
}

public class Endpoint : EndpointConfigurationBuilder
{
public Endpoint()
{
var address = Conventions.EndpointNamingConvention(typeof(EndpointWithTimeoutManager)) + ".Timeouts";

EndpointSetup<DefaultServer>(config => config.DisableFeature<TimeoutManager>())
.WithConfig<UnicastBusConfig>(c => { c.TimeoutManagerAddress = address; });
}

public class MyMessageHandler : IHandleMessages<MyMessage>
{
public Context Context { get; set; }

public Task Handle(MyMessage message, IMessageHandlerContext context)
{
Context.TimeoutManagerHeaderDetected = context.MessageHeaders.ContainsKey("NServiceBus.Timeout.Expire");
Context.WasCalled = true;
return Task.FromResult(0);
}
}
}

public class EndpointWithTimeoutManager : EndpointConfigurationBuilder
{
public EndpointWithTimeoutManager()
{
EndpointSetup<DefaultServer>(config => config.EnableFeature<TimeoutManager>());
}
}

public class MyMessage : IMessage
{
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,24 @@ public async Task A_message_id_is_generated_by_the_transport_layer()
Assert.AreEqual(context.MessageId, context.Headers[Headers.MessageId], "Should populate the NServiceBus.MessageId header with the new value");
}

public class CorruptionBehavior : Behavior<IDispatchContext>
class CorruptionBehavior : IBehavior<IDispatchContext, IDispatchContext>
{
public override Task Invoke(IDispatchContext context, Func<Task> next)
public Task Invoke(IDispatchContext context, Func<IDispatchContext, Task> next)
{
context.Operations.First().Message.Headers[Headers.MessageId] = "";

return next();
return next(context);
}
}

public class Context : ScenarioContext
class Context : ScenarioContext
{
public bool MessageReceived { get; set; }
public string MessageId { get; set; }
public IReadOnlyDictionary<string, string> Headers { get; set; }
}

public class Endpoint : EndpointConfigurationBuilder
class Endpoint : EndpointConfigurationBuilder
{
public Endpoint()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,23 @@ public async Task A_message_id_is_generated_by_the_transport_layer_on_receiving_
Assert.IsFalse(string.IsNullOrWhiteSpace(context.MessageId));
}

public class CorruptionBehavior : Behavior<IDispatchContext>
class CorruptionBehavior : IBehavior<IDispatchContext, IDispatchContext>
{
public override Task Invoke(IDispatchContext context, Func<Task> next)
public Task Invoke(IDispatchContext context, Func<IDispatchContext, Task> next)
{
context.Operations.First().Message.Headers[Headers.MessageId] = null;

return next();
return next(context);
}
}

public class Context : ScenarioContext
class Context : ScenarioContext
{
public bool MessageReceived { get; set; }
public string MessageId { get; set; }
}

public class Endpoint : EndpointConfigurationBuilder
class Endpoint : EndpointConfigurationBuilder
{
public Endpoint()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ public NonTransactionalEndpoint()
});
}

class WrapHandlersInScope : Behavior<IIncomingLogicalMessageContext>
class WrapHandlersInScope : IBehavior<IIncomingLogicalMessageContext, IIncomingLogicalMessageContext>
{
public override async Task Invoke(IIncomingLogicalMessageContext context, Func<Task> next)
public async Task Invoke(IIncomingLogicalMessageContext context, Func<IIncomingLogicalMessageContext, Task> next)
{
using (var tx = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled))
{
await next();
await next(context).ConfigureAwait(false);
tx.Complete();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,33 +30,33 @@ class Context : ScenarioContext
public bool MessageHandled { get; set; }
}

class OriginalBehavior : Behavior<ITransportReceiveContext>
class OriginalBehavior : IBehavior<ITransportReceiveContext, ITransportReceiveContext>
{
public OriginalBehavior(Context testContext)
{
this.testContext = testContext;
}

public override Task Invoke(ITransportReceiveContext context, Func<Task> next)
public Task Invoke(ITransportReceiveContext context, Func<ITransportReceiveContext, Task> next)
{
testContext.OriginalBehaviorInvoked = true;
return next();
return next(context);
}

Context testContext;
}

class ReplacementBehavior : Behavior<ITransportReceiveContext>
class ReplacementBehavior : IBehavior<ITransportReceiveContext, ITransportReceiveContext>
{
public ReplacementBehavior(Context testContext)
{
this.testContext = testContext;
}

public override Task Invoke(ITransportReceiveContext context, Func<Task> next)
public Task Invoke(ITransportReceiveContext context, Func<ITransportReceiveContext, Task> next)
{
testContext.ReplacementBehaviorInvoked = true;
return next();
return next(context);
}

Context testContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public Endpoint()
});
}

class HeaderProcessingBehavior : Behavior<IIncomingLogicalMessageContext>
class HeaderProcessingBehavior : IBehavior<IIncomingLogicalMessageContext, IIncomingLogicalMessageContext>
{
Context testContext;

Expand All @@ -76,13 +76,13 @@ public HeaderProcessingBehavior(Context testContext)
this.testContext = testContext;
}

public override Task Invoke(IIncomingLogicalMessageContext context, Func<Task> next)
public Task Invoke(IIncomingLogicalMessageContext context, Func<IIncomingLogicalMessageContext, Task> next)
{
var uowScopeComponent = context.Builder.Build<UnitOfWorkComponent>();
testContext.ValueAlreadyInitialized |= uowScopeComponent.ValueFromHeader != null;
uowScopeComponent.ValueFromHeader = context.MessageHeaders["Value"];

return next();
return next(context);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ public Task Handle(SubsequentMessage message, IMessageHandlerContext context)
}
}

class ThrowingBehavior : Behavior<ITransportReceiveContext>
class ThrowingBehavior : IBehavior<ITransportReceiveContext, ITransportReceiveContext>
{
public override async Task Invoke(ITransportReceiveContext context, Func<Task> next)
public async Task Invoke(ITransportReceiveContext context, Func<ITransportReceiveContext, Task> next)
{
await next().ConfigureAwait(false);
await next(context).ConfigureAwait(false);

throw new SimulatedException();
}
Expand Down
Loading

0 comments on commit 4d0ec56

Please sign in to comment.