pekko/akka-docs/rst/general/code/docs/config/ConfigDocSpec.scala

35 lines
888 B
Scala
Raw Normal View History

/**
2013-01-09 01:47:48 +01:00
* Copyright (C) 2009-2013 Typesafe Inc. <http://www.typesafe.com>
*/
package docs.config
import org.scalatest.WordSpec
import org.scalatest.matchers.MustMatchers
import akka.testkit.TestKit
//#imports
import akka.actor.ActorSystem
import com.typesafe.config.ConfigFactory
//#imports
2011-12-05 10:41:36 +01:00
class ConfigDocSpec extends WordSpec with MustMatchers {
"programmatically configure ActorSystem" in {
//#custom-config
val customConf = ConfigFactory.parseString("""
akka.actor.deployment {
/my-service {
router = round-robin
nr-of-instances = 3
}
}
""")
2011-12-05 10:41:36 +01:00
// ConfigFactory.load sandwiches customConfig between default reference
// config and default overrides, and then resolves it.
val system = ActorSystem("MySystem", ConfigFactory.load(customConf))
//#custom-config
TestKit.shutdownActorSystem(system)
}
}