From 031b5c22effe5368eaafcfad519882d1603e2679 Mon Sep 17 00:00:00 2001 From: Heiko Seeberger Date: Tue, 8 Mar 2011 04:58:57 +0100 Subject: [PATCH] re #689: Verified config for akka-actor. --- .../test/scala/akka/config/ConfigSpec.scala | 46 +++++++++++++++++++ config/akka-reference.conf | 11 +++-- 2 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 akka-actor/src/test/scala/akka/config/ConfigSpec.scala diff --git a/akka-actor/src/test/scala/akka/config/ConfigSpec.scala b/akka-actor/src/test/scala/akka/config/ConfigSpec.scala new file mode 100644 index 0000000000..4a4847e3eb --- /dev/null +++ b/akka-actor/src/test/scala/akka/config/ConfigSpec.scala @@ -0,0 +1,46 @@ +/** + * Copyright (C) 2009-2011 Scalable Solutions AB + */ + +package akka.config + +import org.junit.runner.RunWith +import org.scalatest.WordSpec +import org.scalatest.junit.JUnitRunner +import org.scalatest.matchers.MustMatchers + +@RunWith(classOf[JUnitRunner]) +class ConfigSpec extends WordSpec with MustMatchers { + + "The default configuration file (i.e. akka-reference.conf)" should { + "contain all configuration properties for akka-actor that are used in code with their correct defaults" in { + import Config.config._ + + getList("akka.boot") must equal(Nil) + getBool("akka.default-error-handler") must equal(Some(true)) + getString("akka.time-unit") must equal(Some("seconds")) + getString("akka.version") must equal(Some("1.1-SNAPSHOT")) + + getString("akka.actor.default-dispatcher.type") must equal(Some("GlobalExecutorBasedEventDriven")) + getInt("akka.actor.default-dispatcher.keep-alive-time") must equal(Some(60)) + getDouble("akka.actor.default-dispatcher.core-pool-size-factor") must equal(Some(1.0)) + getDouble("akka.actor.default-dispatcher.max-pool-size-factor") must equal(Some(4.0)) + getInt("akka.actor.default-dispatcher.executor-bounds") must equal(Some(-1)) + getBool("akka.actor.default-dispatcher.allow-core-timeout") must equal(Some(true)) + getString("akka.actor.default-dispatcher.rejection-policy") must equal(Some("caller-runs")) + getInt("akka.actor.default-dispatcher.mailbox-capacity") must equal(Some(-1)) + getInt("akka.actor.default-dispatcher.mailbox-push-timeout-time") must equal(Some(10)) + getLong("akka.actor.dispatcher-shutdown-timeout") must equal(Some(1)) + getInt("akka.actor.default-dispatcher.throughput") must equal(Some(5)) + getInt("akka.actor.default-dispatcher.throughput-deadline-time") must equal(Some(-1)) + getBool("akka.actor.serialize-messages") must equal(Some(false)) + getInt("akka.actor.timeout") must equal(Some(5)) + getInt("akka.actor.throughput") must equal(Some(5)) + getInt("akka.actor.throughput-deadline-time") must equal(Some(-1)) + + getString("akka.remote.layer") must equal(Some("akka.remote.netty.NettyRemoteSupport")) + getString("akka.remote.server.hostname") must equal(Some("localhost")) + getInt("akka.remote.server.port") must equal(Some(2552)) + } + } +} diff --git a/config/akka-reference.conf b/config/akka-reference.conf index b4bf1c672e..fceb0ca4a9 100644 --- a/config/akka-reference.conf +++ b/config/akka-reference.conf @@ -17,10 +17,11 @@ akka { # These boot classes are loaded (and created) automatically when the Akka Microkernel boots up # Can be used to bootstrap your application(s) # Should be the FQN (Fully Qualified Name) of the boot class which needs to have a default constructor - boot = ["sample.camel.Boot", - "sample.rest.java.Boot", - "sample.rest.scala.Boot", - "sample.security.Boot"] + # boot = ["sample.camel.Boot", + # "sample.rest.java.Boot", + # "sample.rest.scala.Boot", + # "sample.security.Boot"] + boot = [] actor { timeout = 5 # Default timeout for Future based invocations @@ -118,6 +119,8 @@ akka { compression-scheme = "zlib" # Options: "zlib" (lzf to come), leave out for no compression zlib-compression-level = 6 # Options: 0-9 (1 being fastest and 9 being the most compressed), default is 6 + layer = "akka.remote.netty.NettyRemoteSupport" + server { hostname = "localhost" # The hostname or IP that clients should connect to port = 2552 # The port clients should connect to. Default is 2552 (AKKA)