Added regressiontest for spawn

This commit is contained in:
Viktor Klang 2010-05-20 20:36:05 +02:00
parent 40113f8042
commit a9debdec59

View file

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