Created
February 1, 2011 15:54
-
-
Save debasishg/806049 to your computer and use it in GitHub Desktop.
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
| package akka.persistence.redis | |
| import org.scalatest.junit.JUnitSuite | |
| import org.junit.{Test, Before} | |
| import org.junit.Assert._ | |
| import akka.actor.{Actor, ActorRef} | |
| import akka.actor.Actor._ | |
| import akka.stm._ | |
| class Perman extends Actor { | |
| val msglog = RedisStorage.getVector("svd.log") | |
| def receive = { | |
| case msg: String => | |
| atomic { | |
| msglog + msg.getBytes("UTF-8") | |
| } | |
| println(msglog.map(bytes => new String(bytes, "UTF-8")).toList) | |
| case _ => | |
| } | |
| } | |
| class RedisBadSpec extends JUnitSuite { | |
| @Test | |
| def testAdd = { | |
| val bactor = actorOf[Perman] | |
| bactor.start | |
| bactor ! "One" | |
| bactor ! "Two" | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment