Hi Erich,

As Tim pointed out, one way is to use an in-memory journal and use the
ordinary akka TestKit. To simulate failures you may use the Kill message (
http://doc.akka.io/docs/akka/2.3.2/scala/actors.html#Killing_an_Actor) that
will force the actor to throw an ActorKilledException. It might be less
elegant than subclassing your processor, but sometimes it is exactly what
you want.

-Endre


On Wed, Apr 30, 2014 at 9:32 AM, Tim Pigden <tim.pig...@optrak.com> wrote:

> I don't know if this answers your question but this is what I did:
>
> I just used a normal specs2 test with TestKit
> In order to test full cycle I used
>
>   "com.github.michaelpisula" %% "akka-persistence-inmemory" %
> "0.1-SNAPSHOT" % "test"
>
> which requires
>
> akka.persistence.journal.plugin = "akka.persistence.journal.inmem"
>
> in my test application.conf
>
> Then to test recovery I subclassed my eventsourced processor so that I
> could send it a "class object Bomb" which would make it throw an exception.
> Running it from a supervisor with default restart values and the supervisor
> restarted it and replayed the events nicely keeping the ActorRef valid. I
> used inmem because it makes the tests easily repeatable without worrying
> about deleting old journal records.
>
>
>
>
>
>
> On Tuesday, April 29, 2014 10:54:53 PM UTC+1, erich oliphant wrote:
>>
>> I've not seen any in the examples (activator, etc).  I looked in the
>> tests for akka-persistence itself, but not sure what's actually necessary
>> from that.  Do I need to pull-in/create something like PersistenceSpec, etc
>> in order to test?
>>
>  --
> >>>>>>>>>> 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.
>



-- 
Akka Team
Typesafe - The software stack for applications that scale
Blog: letitcrash.com
Twitter: @akkateam

-- 
>>>>>>>>>>      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