2011-03-08 04:58:57 +01:00
|
|
|
/**
|
2011-07-14 16:03:08 +02:00
|
|
|
* Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
|
2011-03-08 04:58:57 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
package akka.config
|
|
|
|
|
|
2011-10-11 16:05:48 +02:00
|
|
|
import akka.testkit.AkkaSpec
|
2011-11-15 11:34:39 +01:00
|
|
|
import com.typesafe.config.ConfigFactory
|
|
|
|
|
import scala.collection.JavaConverters._
|
2011-11-23 15:15:44 +01:00
|
|
|
import akka.util.duration._
|
2011-11-15 11:34:39 +01:00
|
|
|
import akka.util.Duration
|
2011-03-08 04:58:57 +01:00
|
|
|
|
2011-10-21 17:01:22 +02:00
|
|
|
@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
|
2011-11-29 11:50:22 +01:00
|
|
|
class ConfigSpec extends AkkaSpec(ConfigFactory.defaultReference) {
|
2011-03-08 04:58:57 +01:00
|
|
|
|
2011-12-07 11:25:35 +01:00
|
|
|
"The default configuration file (i.e. reference.conf)" must {
|
2011-03-08 04:58:57 +01:00
|
|
|
"contain all configuration properties for akka-actor that are used in code with their correct defaults" in {
|
2011-10-11 16:05:48 +02:00
|
|
|
|
2011-11-15 11:34:39 +01:00
|
|
|
val settings = system.settings
|
|
|
|
|
val config = settings.config
|
2011-10-11 16:05:48 +02:00
|
|
|
import config._
|
2011-03-08 04:58:57 +01:00
|
|
|
|
2011-11-15 11:34:39 +01:00
|
|
|
getString("akka.version") must equal("2.0-SNAPSHOT")
|
|
|
|
|
settings.ConfigVersion must equal("2.0-SNAPSHOT")
|
|
|
|
|
|
|
|
|
|
getString("akka.actor.default-dispatcher.type") must equal("Dispatcher")
|
2011-12-20 21:08:27 +01:00
|
|
|
getString("akka.actor.default-dispatcher.name") must equal("default-dispatcher")
|
2011-11-21 10:48:21 +01:00
|
|
|
getMilliseconds("akka.actor.default-dispatcher.keep-alive-time") must equal(60 * 1000)
|
2012-01-17 17:28:57 +01:00
|
|
|
getDouble("akka.actor.default-dispatcher.core-pool-size-factor") must equal(3.0)
|
|
|
|
|
getDouble("akka.actor.default-dispatcher.max-pool-size-factor") must equal(3.0)
|
2011-11-15 11:34:39 +01:00
|
|
|
getInt("akka.actor.default-dispatcher.task-queue-size") must equal(-1)
|
|
|
|
|
getString("akka.actor.default-dispatcher.task-queue-type") must equal("linked")
|
|
|
|
|
getBoolean("akka.actor.default-dispatcher.allow-core-timeout") must equal(true)
|
|
|
|
|
getInt("akka.actor.default-dispatcher.mailbox-capacity") must equal(-1)
|
2011-11-21 10:48:21 +01:00
|
|
|
getMilliseconds("akka.actor.default-dispatcher.mailbox-push-timeout-time") must equal(10 * 1000)
|
2011-12-19 20:36:06 +01:00
|
|
|
getString("akka.actor.default-dispatcher.mailboxType") must be("")
|
2011-12-20 13:40:29 +01:00
|
|
|
getMilliseconds("akka.actor.default-dispatcher.shutdown-timeout") must equal(1 * 1000)
|
2011-11-15 11:34:39 +01:00
|
|
|
getInt("akka.actor.default-dispatcher.throughput") must equal(5)
|
2011-11-21 10:48:21 +01:00
|
|
|
getMilliseconds("akka.actor.default-dispatcher.throughput-deadline-time") must equal(0)
|
2011-11-15 11:34:39 +01:00
|
|
|
getBoolean("akka.actor.serialize-messages") must equal(false)
|
|
|
|
|
settings.SerializeAllMessages must equal(false)
|
|
|
|
|
|
2011-03-08 04:58:57 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|