Merged patterns code into module
This commit is contained in:
parent
a92a90bb72
commit
8829ceacbb
5 changed files with 370 additions and 0 deletions
24
akka-patterns/src/test/scala/AgentTest.scala
Normal file
24
akka-patterns/src/test/scala/AgentTest.scala
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
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}
|
||||
|
||||
@RunWith(classOf[JUnitRunner])
|
||||
class AgentTest extends junit.framework.TestCase with Suite with MustMatchers with ActorTestUtil with Logging {
|
||||
@Test def testAgent = verify(new TestActor {
|
||||
def test = {
|
||||
val t = Agent(5)
|
||||
handle(t){
|
||||
t.update( _ + 1 )
|
||||
t.update( _ * 2 )
|
||||
|
||||
val r = t()
|
||||
r must be (12)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue