From a9debdec5980e82fe012e653e4d4c817e7fe0efc Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Thu, 20 May 2010 20:36:05 +0200 Subject: [PATCH] Added regressiontest for spawn --- akka-core/src/test/scala/AgentUtilTest.scala | 23 ++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 akka-core/src/test/scala/AgentUtilTest.scala diff --git a/akka-core/src/test/scala/AgentUtilTest.scala b/akka-core/src/test/scala/AgentUtilTest.scala new file mode 100644 index 0000000000..348bf52a2b --- /dev/null +++ b/akka-core/src/test/scala/AgentUtilTest.scala @@ -0,0 +1,23 @@ +package se.scalablesolutions.akka.actor + +import org.scalatest.Suite +import org.junit.runner.RunWith +import org.scalatest.junit.JUnitRunner +import org.scalatest.matchers.MustMatchers +import org.junit.{Before, After, Test} +import java.util.concurrent.{ CountDownLatch, TimeUnit } + +@RunWith(classOf[JUnitRunner]) +class ActorUtilTest extends junit.framework.TestCase with Suite with MustMatchers { + import Actor._ + @Test def testSpawn = { + val latch = new CountDownLatch(1) + + spawn { + latch.countDown + } + + val done = latch.await(5,TimeUnit.SECONDS) + done must be (true) + } +} \ No newline at end of file