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-10 20:08:00 +01:00
|
|
|
import akka.actor.ActorSystem
|
2011-11-15 11:34:39 +01:00
|
|
|
import java.io.File
|
|
|
|
|
import com.typesafe.config.ConfigFactory
|
|
|
|
|
import com.typesafe.config.ConfigParseOptions
|
|
|
|
|
import scala.collection.JavaConverters._
|
|
|
|
|
import java.util.concurrent.TimeUnit
|
|
|
|
|
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-15 11:34:39 +01:00
|
|
|
class ConfigSpec extends AkkaSpec(ConfigFactory.parseResource(classOf[ConfigSpec], "/akka-actor-reference.conf", ConfigParseOptions.defaults)) {
|
2011-03-08 04:58:57 +01:00
|
|
|
|
2011-11-15 11:34:39 +01:00
|
|
|
"The default configuration file (i.e. akka-actor-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
|
|
|
getList("akka.boot").asScala.toSeq must equal(Nil)
|
|
|
|
|
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-11-21 10:48:21 +01:00
|
|
|
getMilliseconds("akka.actor.default-dispatcher.keep-alive-time") must equal(60 * 1000)
|
2011-11-15 11:34:39 +01:00
|
|
|
getDouble("akka.actor.default-dispatcher.core-pool-size-factor") must equal(8.0)
|
|
|
|
|
getDouble("akka.actor.default-dispatcher.max-pool-size-factor") must equal(8.0)
|
|
|
|
|
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)
|
|
|
|
|
getMilliseconds("akka.actor.dispatcher-shutdown-timeout") must equal(1 * 1000)
|
2011-11-15 11:34:39 +01:00
|
|
|
settings.DispatcherDefaultShutdown must equal(Duration(1, TimeUnit.SECONDS))
|
|
|
|
|
getInt("akka.actor.default-dispatcher.throughput") must equal(5)
|
|
|
|
|
settings.DispatcherThroughput must equal(5)
|
2011-11-21 10:48:21 +01:00
|
|
|
getMilliseconds("akka.actor.default-dispatcher.throughput-deadline-time") must equal(0)
|
|
|
|
|
settings.DispatcherThroughputDeadlineTime must equal(Duration.Zero)
|
2011-11-15 11:34:39 +01:00
|
|
|
getBoolean("akka.actor.serialize-messages") must equal(false)
|
|
|
|
|
settings.SerializeAllMessages must equal(false)
|
|
|
|
|
|
|
|
|
|
getString("akka.remote.layer") must equal("akka.cluster.netty.NettyRemoteSupport")
|
|
|
|
|
getInt("akka.remote.server.port") must equal(2552)
|
2011-03-08 04:58:57 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|