Skip to content

Instantly share code, notes, and snippets.

@debasishg
Created February 1, 2011 15:54
Show Gist options
  • Select an option

  • Save debasishg/806049 to your computer and use it in GitHub Desktop.

Select an option

Save debasishg/806049 to your computer and use it in GitHub Desktop.
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