On Wed, Aug 5, 2015 at 8:23 AM, Heiko Seeberger <loe...@posteo.de> wrote:

> On 04 Aug 2015, at 22:52, Patrik Nordwall <patrik.nordw...@gmail.com>
> wrote:
>
> There is no support in testkit for creating fake Terminated messages. That
> would probably be a nice addition.
>
> I guess you have already explored and rejected the option to actually stop
> the watched actor in the test.
>
>
> Sort of. I’m implementing a simple publish-subscribe solution. The
> mediator watches subscribers and removes these upon termination. The latter
> I would like to test, i.e. be sure that terminated actors are removed from
> the mediator. Stopping a subscriber means that it is “hard to use” in
> assertions ;-)
>
> Any ideas how to test this? Maybe TestActorRef is the only way ...
>

I would use a separate message to request the current subscribers that you
can use from the test to verify that the stopped subscriber is removed from
the mediator.


>
> Thanks
> Heiko
>
>
>
> /Patrik
>
> On Tue, Aug 4, 2015 at 9:27 AM, Heiko Seeberger <loe...@posteo.de> wrote:
>
>> Sigh! Looks like using reflection doesn’t work, as Akka treats Terminated
>> specially (DeathWatch.receivedTerminated).
>> Is there support from TestKit?
>>
>> Heiko
>>
>> --
>>
>> *Heiko Seeberger*
>> Home: heikoseeberger.de
>> Twitter: @hseeberger <https://twitter.com/hseeberger>
>> Public key: keybase.io/hseeberger
>>
>> On 04 Aug 2015, at 08:51, Heiko Seeberger <loe...@posteo.de> wrote:
>>
>> Hi,
>>
>> What’s the idiomatic way to test that an actor handles Terminated
>> messages correctly? Is there some support from akka-testkit to create  a
>> Terminated instance? Or should we use reflection?
>>
>> Thanks
>> Heiko
>>
>> --
>>
>> *Heiko Seeberger*
>> Home: heikoseeberger.de
>> Twitter: @hseeberger <https://twitter.com/hseeberger>
>> Public key: keybase.io/hseeberger
>>
>>
>> --
>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>> >>>>>>>>>> Check the FAQ:
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to akka-user+unsubscr...@googlegroups.com.
>> To post to this group, send email to akka-user@googlegroups.com.
>> Visit this group at http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>> --
>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>> >>>>>>>>>> Check the FAQ:
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to akka-user+unsubscr...@googlegroups.com.
>> To post to this group, send email to akka-user@googlegroups.com.
>> Visit this group at http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
>
> Patrik Nordwall
> Typesafe <http://typesafe.com/> -  Reactive apps on the JVM
> Twitter: @patriknw
>
>
> --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ:
> http://doc.akka.io/docs/akka/current/additional/faq.html
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to akka-user+unsubscr...@googlegroups.com.
> To post to this group, send email to akka-user@googlegroups.com.
> Visit this group at http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ:
> http://doc.akka.io/docs/akka/current/additional/faq.html
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to akka-user+unsubscr...@googlegroups.com.
> To post to this group, send email to akka-user@googlegroups.com.
> Visit this group at http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Patrik Nordwall
Typesafe <http://typesafe.com/> -  Reactive apps on the JVM
Twitter: @patriknw

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to