Created
May 8, 2015 18:29
-
-
Save phatboyg/51ccd77692621b70627a to your computer and use it in GitHub Desktop.
Failing Test that hangs somewhere in the TPL/blocked... UGH!!
This file contains hidden or 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
DEBUG 2015-05-08 11:21:13 - Connecting: guest@localhost:5672/test | |
DEBUG 2015-05-08 11:21:13 - Connected: guest@localhost:5672/test | |
DEBUG 2015-05-08 11:21:13 - Queue: input_queue (durable) | |
DEBUG 2015-05-08 11:21:13 - Purging 0 messages from queue input_queue | |
DEBUG 2015-05-08 11:21:13 - Purged 0 messages from queue input_queue | |
DEBUG 2015-05-08 11:21:14 - ConsumerOk: rabbitmq://localhost:5672/test/input_queue - amq.ctag-OJZQVjuoAKvlmZ9cG9b6lg | |
DEBUG 2015-05-08 11:21:14 - Queue: bus-JetBrains.ReSharper.TaskRunner.CLR45.x64-CPATTERSON-DEVM-08d257d2e6a39a1100ffb01be8550000 (exclusive, auto-delete) | |
DEBUG 2015-05-08 11:21:14 - ConsumerOk: rabbitmq://localhost:5672/test/bus-JetBrains.ReSharper.TaskRunner.CLR45.x64-CPATTERSON-DEVM-08d257d2e6a39a1100ffb01be8550000 - amq.ctag-D_1vYS5_TQ7O4cGojNAI_Q | |
DEBUG 2015-05-08 11:21:14 - Connecting: guest@localhost:5672/test | |
DEBUG 2015-05-08 11:21:14 - Connected: guest@localhost:5672/test | |
DEBUG 2015-05-08 11:21:14 - Created new model: 1 | |
DEBUG 2015-05-08 11:21:14 - Exchange: input_queue (durable) | |
DEBUG 2015-05-08 11:21:14 - Sending MassTransit.TestFramework.Messages.PingMessage to input_queue | |
DEBUG 2015-05-08 11:21:14 - Creating publish endpoint: MassTransit.RabbitMqTransport.Tests.EventPublish_Specs+PingReceived | |
DEBUG 2015-05-08 11:21:15 - Created new model: 2 | |
DEBUG 2015-05-08 11:21:15 - Exchange: MassTransit.RabbitMqTransport.Tests:EventPublish_Specs-PingReceived (durable) | |
DEBUG 2015-05-08 11:21:15 - Sending MassTransit.RabbitMqTransport.Tests.EventPublish_Specs+PingReceived to MassTransit.RabbitMqTransport.Tests:EventPublish_Specs-PingReceived | |
DEBUG 2015-05-08 11:21:15 - Creating publish endpoint: MassTransit.RabbitMqTransport.Tests.EventPublish_Specs+PingConsumed | |
INFO 2015-05-08 11:21:43 - Consumer amq.ctag-OJZQVjuoAKvlmZ9cG9b6lg: 2 received, 2 concurrent | |
DEBUG 2015-05-08 11:21:43 - ModelShutdown (amq.ctag-OJZQVjuoAKvlmZ9cG9b6lg), Max: 2, 200-ModelContext Disposed | |
DEBUG 2015-05-08 11:21:43 - ModelShutdown (amq.ctag-OJZQVjuoAKvlmZ9cG9b6lg), Max: 2, 200-ModelContext Disposed | |
INFO 2015-05-08 11:21:43 - Consumer amq.ctag-D_1vYS5_TQ7O4cGojNAI_Q: 0 received, 0 concurrent | |
DEBUG 2015-05-08 11:21:43 - ModelShutdown (amq.ctag-D_1vYS5_TQ7O4cGojNAI_Q), Max: 0, 200-ModelContext Disposed | |
DEBUG 2015-05-08 11:21:43 - ModelShutdown (amq.ctag-D_1vYS5_TQ7O4cGojNAI_Q), Max: 0, 200-ModelContext Disposed | |
DEBUG 2015-05-08 11:21:43 - Disconnecting: guest@localhost:5672/test | |
DEBUG 2015-05-08 11:21:43 - Disconnected: guest@localhost:5672/test |
This file contains hidden or 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
namespace MassTransit.RabbitMqTransport.Tests | |
{ | |
using System; | |
using System.Threading.Tasks; | |
using Configuration; | |
using NUnit.Framework; | |
using TestFramework.Messages; | |
[TestFixture] | |
public class EventPublish_Specs : | |
RabbitMqTestFixture | |
{ | |
Task<ConsumeContext<PingReceived>> _received; | |
Task<ConsumeContext<PingConsumed>> _consumed; | |
[Test] | |
public async void Should_publish_first_event() | |
{ | |
var received = await _received; | |
} | |
[Test] | |
public async void Should_publish_second_event() | |
{ | |
var consumed = await _consumed; | |
} | |
[TestFixtureSetUp] | |
public void Setup() | |
{ | |
Await(() => InputQueueSendEndpoint.Send(new PingMessage())); | |
} | |
protected override void ConfigureInputQueueEndpoint(IRabbitMqReceiveEndpointConfigurator configurator) | |
{ | |
configurator.Consumer<Consumar>(); | |
_received = Handled<PingReceived>(configurator); | |
_consumed = Handled<PingConsumed>(configurator); | |
} | |
class Consumar : | |
IConsumer<PingMessage> | |
{ | |
public async Task Consume(ConsumeContext<PingMessage> context) | |
{ | |
await context.Publish<PingReceived>(new | |
{ | |
PingId = context.Message.CorrelationId, | |
Timestamp = DateTime.UtcNow, | |
}); | |
Console.WriteLine("Ping: {0}", context.Message.CorrelationId); | |
await context.Publish<PingConsumed>(new | |
{ | |
PingId = context.Message.CorrelationId, | |
Timestamp = DateTime.UtcNow, | |
}); | |
} | |
} | |
public interface PingReceived | |
{ | |
Guid PingId { get; } | |
DateTime Timestamp { get; } | |
} | |
public interface PingConsumed | |
{ | |
Guid PingId { get; } | |
DateTime Timestamp { get; } | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment