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-23 19:49:01 +01:00
|
|
|
/*
|
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-23 19:49:01 +01:00
|
|
|
|
2010-02-13 21:45:35 +01:00
|
|
|
@Test def testAgent = verify(new TestActor {
|
2010-02-23 19:49:01 +01:00
|
|
|
def test = {
|
|
|
|
|
atomic {
|
2010-02-13 21:45:35 +01:00
|
|
|
val t = Agent(5)
|
2010-02-23 19:49:01 +01:00
|
|
|
handle(t) {
|
|
|
|
|
t.update(_ + 1)
|
|
|
|
|
t.update(_ * 2)
|
2010-02-13 21:45:35 +01:00
|
|
|
|
2010-02-23 19:49:01 +01:00
|
|
|
val r = t()
|
|
|
|
|
r must be(12)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2010-02-13 21:45:35 +01:00
|
|
|
})
|
2010-02-23 19:49:01 +01:00
|
|
|
}
|
2010-03-03 12:47:42 +01:00
|
|
|
*/
|