Hey Sam,

if you are extending TestKitBase trait then his is the way to go : 

TestActorRef[TestActor].underlyingActor.context



On Thursday, February 19, 2015 at 5:58:15 PM UTC+1, Sam Halliday wrote:
>
> On Thursday, 19 February 2015 16:54:47 UTC, Heiko Seeberger wrote:
>>
>> What about using an ActorRefFactory?
>>
>
> Yeah, I thought about that but I also need an ActorSystem (it's using 
> akka.io) and typically when you need both an ActorSystem and an 
> ActorRefFactory the implicit resolution gets a bit nasty on the caller side.
>
>  
>
>> --
>>
>> *Heiko Seeberger*
>> Home: heikoseeberger.de
>> Twitter: @hseeberger <https://twitter.com/hseeberger>
>> Public key: keybase.io/hseeberger
>>
>> On 19 Feb 2015, at 17:49, Sam Halliday <[email protected]> wrote:
>>
>> Hi all,
>>
>> I wrote a little convenience method that starts up a bunch of actors, and 
>> I intentionally take in an ActorContext because this is typically used with 
>> a supervisor strategy.
>>
>> However, when I'm testing it (and also writing examples for people to 
>> easily understand the API), it would be incredibly convenient if the 
>> ActorContext that spawns the actors was the Guardian.
>>
>> Is there any way to do this, or must I write a little dumb supervisor 
>> (such as below) to do this? I tried searching in TestKit but didn't come up 
>> with anything.
>>
>>    class DumbSupervisorActor extends Actor {
>>     override def preStart(): Unit = {
>>       startAllTheThings()
>>     }
>>     def receive = Actor.emptyBehavior
>>   }
>>
>> Best regards,
>> Sam
>>
>> -- 
>> >>>>>>>>>> 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 [email protected].
>> To post to this group, send email to [email protected].
>> 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 [email protected].
To post to this group, send email to [email protected].
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