pekko/akka-core/src/test/scala/AgentTest.scala

30 lines
657 B
Scala
Raw Normal View History

2010-02-13 21:45:35 +01:00
package se.scalablesolutions.akka.actor
import org.scalatest.Suite
import se.scalablesolutions.akka.util.Logging
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
import org.scalatest.matchers.MustMatchers
import org.junit.{Test}
/*
2010-02-13 21:45:35 +01:00
@RunWith(classOf[JUnitRunner])
class AgentTest extends junit.framework.TestCase with Suite with MustMatchers with ActorTestUtil with Logging {
2010-02-13 21:45:35 +01:00
@Test def testAgent = verify(new TestActor {
def test = {
atomic {
2010-02-13 21:45:35 +01:00
val t = Agent(5)
handle(t) {
t.update(_ + 1)
t.update(_ * 2)
2010-02-13 21:45:35 +01:00
val r = t()
r must be(12)
}
}
}
2010-02-13 21:45:35 +01:00
})
}
2010-03-03 12:47:42 +01:00
*/