Merged patterns code into module

This commit is contained in:
Viktor Klang 2010-02-13 21:45:35 +01:00
parent a92a90bb72
commit 8829ceacbb
5 changed files with 370 additions and 0 deletions

View 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)
}
}
})
}