From c2a8e8d6a6d7654b15c093b55040aa3d00ea8928 Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Mon, 26 Sep 2011 15:34:08 +0200 Subject: [PATCH] Fixing broken camel test --- .../camel/TypedConsumerPublishRequestorTest.scala | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/akka-camel-typed/src/test/scala/akka/camel/TypedConsumerPublishRequestorTest.scala b/akka-camel-typed/src/test/scala/akka/camel/TypedConsumerPublishRequestorTest.scala index 5d145b0249..dba1e05997 100644 --- a/akka-camel-typed/src/test/scala/akka/camel/TypedConsumerPublishRequestorTest.scala +++ b/akka-camel-typed/src/test/scala/akka/camel/TypedConsumerPublishRequestorTest.scala @@ -50,12 +50,22 @@ class TypedConsumerPublishRequestorTest extends JUnitSuite { @Test def shouldReceiveOneConsumerMethodUnregisteredEvent = { - val obj = TypedActor.typedActorOf(classOf[SampleTypedSingleConsumer], classOf[SampleTypedSingleConsumerImpl], Props()) val latch = (publisher ? SetExpectedTestMessageCount(1)).as[CountDownLatch].get Actor.registry.addListener(requestor) - TypedActor.stop(obj) + + val obj = TypedActor.typedActorOf(classOf[SampleTypedSingleConsumer], classOf[SampleTypedSingleConsumerImpl], Props()) + assert(latch.await(5000, TimeUnit.MILLISECONDS)) + + val ignorableEvent = (publisher ? GetRetainedMessage).as[ConsumerMethodRegistered].get + + val latch2 = (publisher ? SetExpectedTestMessageCount(1)).as[CountDownLatch].get + TypedActor.stop(obj) + + assert(latch2.await(5000, TimeUnit.MILLISECONDS)) + val event = (publisher ? GetRetainedMessage).as[ConsumerMethodUnregistered].get + assert(event.endpointUri === "direct:foo") assert(event.typedActor === obj) assert(event.methodName === "foo")