2012-01-20 14:29:50 +01:00
|
|
|
/**
|
2013-01-09 01:47:48 +01:00
|
|
|
* Copyright (C) 2009-2013 Typesafe Inc. <http://www.typesafe.com>
|
2012-01-20 14:29:50 +01:00
|
|
|
*/
|
2011-11-22 13:04:10 +01:00
|
|
|
package akka.remote
|
2011-07-20 11:14:51 +03:00
|
|
|
|
2012-06-25 16:29:08 +02:00
|
|
|
import language.postfixOps
|
|
|
|
|
|
2011-10-11 16:05:48 +02:00
|
|
|
import akka.testkit.AkkaSpec
|
2012-01-25 16:50:06 +01:00
|
|
|
import akka.actor.ExtendedActorSystem
|
2012-09-21 14:50:06 +02:00
|
|
|
import scala.concurrent.duration._
|
2013-01-17 16:19:31 +01:00
|
|
|
import akka.remote.transport.AkkaProtocolSettings
|
|
|
|
|
import akka.util.{ Timeout, Helpers }
|
2011-07-20 11:14:51 +03:00
|
|
|
|
2011-10-21 17:01:22 +02:00
|
|
|
@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
|
2012-01-25 16:50:06 +01:00
|
|
|
class RemoteConfigSpec extends AkkaSpec(
|
|
|
|
|
"""
|
2013-01-24 09:53:18 +01:00
|
|
|
akka.actor.provider = "akka.remote.RemoteActorRefProvider"
|
2013-01-17 16:19:31 +01:00
|
|
|
akka.remote.netty.tcp.port = 0
|
2012-01-25 16:50:06 +01:00
|
|
|
""") {
|
2011-07-20 11:14:51 +03:00
|
|
|
|
2012-12-18 12:54:17 +01:00
|
|
|
// FIXME: These tests are ignored as it tests configuration specific to the old remoting.
|
2012-01-30 11:48:02 +01:00
|
|
|
"Remoting" must {
|
|
|
|
|
|
2013-01-17 16:19:31 +01:00
|
|
|
"be able to parse generic remote config elements" in {
|
|
|
|
|
val settings = RARP(system).provider.remoteSettings
|
2012-01-20 14:29:50 +01:00
|
|
|
import settings._
|
|
|
|
|
|
2013-01-17 16:19:31 +01:00
|
|
|
StartupTimeout must be === Timeout(5.seconds)
|
|
|
|
|
ShutdownTimeout must be === Timeout(5.seconds)
|
|
|
|
|
FlushWait must be === 2.seconds
|
|
|
|
|
UsePassiveConnections must be(true)
|
2012-01-20 14:29:50 +01:00
|
|
|
UntrustedMode must be(false)
|
2013-01-17 16:19:31 +01:00
|
|
|
LogRemoteLifecycleEvents must be(false)
|
|
|
|
|
LogReceive must be(false)
|
|
|
|
|
LogSend must be(false)
|
2013-01-28 14:38:33 +01:00
|
|
|
RetryGateClosedFor must be === 0.seconds
|
|
|
|
|
UnknownAddressGateClosedFor must be === 10.seconds
|
2013-01-17 16:19:31 +01:00
|
|
|
MaximumRetriesInWindow must be === 5
|
|
|
|
|
RetryWindow must be === 3.seconds
|
|
|
|
|
BackoffPeriod must be === 10.milliseconds
|
|
|
|
|
CommandAckTimeout must be === Timeout(30.seconds)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
"be able to parse AkkaProtocol related config elements" in {
|
|
|
|
|
val settings = new AkkaProtocolSettings(RARP(system).provider.remoteSettings.config)
|
|
|
|
|
import settings._
|
|
|
|
|
|
|
|
|
|
WaitActivityEnabled must be(true)
|
|
|
|
|
FailureDetectorThreshold must be === 7
|
|
|
|
|
FailureDetectorMaxSampleSize must be === 100
|
|
|
|
|
FailureDetectorStdDeviation must be === 100.milliseconds
|
|
|
|
|
AcceptableHeartBeatPause must be === 3.seconds
|
|
|
|
|
HeartBeatInterval must be === 1.seconds
|
|
|
|
|
RequireCookie must be(false)
|
|
|
|
|
SecureCookie must be === ""
|
2011-07-20 11:14:51 +03:00
|
|
|
}
|
2012-01-30 11:48:02 +01:00
|
|
|
|
2013-01-17 16:19:31 +01:00
|
|
|
"contain correct configuration values in reference.conf" ignore {
|
|
|
|
|
val c = RARP(system).provider.remoteSettings.config.getConfig("akka.remote.netty.tcp")
|
2012-10-29 14:37:39 +01:00
|
|
|
|
|
|
|
|
// server-socket-worker-pool
|
|
|
|
|
{
|
|
|
|
|
val pool = c.getConfig("server-socket-worker-pool")
|
|
|
|
|
pool.getInt("pool-size-min") must equal(2)
|
|
|
|
|
pool.getDouble("pool-size-factor") must equal(1.0)
|
|
|
|
|
pool.getInt("pool-size-max") must equal(8)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// client-socket-worker-pool
|
|
|
|
|
{
|
|
|
|
|
val pool = c.getConfig("client-socket-worker-pool")
|
|
|
|
|
pool.getInt("pool-size-min") must equal(2)
|
|
|
|
|
pool.getDouble("pool-size-factor") must equal(1.0)
|
|
|
|
|
pool.getInt("pool-size-max") must equal(8)
|
|
|
|
|
}
|
2012-12-17 20:44:59 +01:00
|
|
|
|
|
|
|
|
{
|
|
|
|
|
c.getString("reuse-address") must be("off-for-windows")
|
|
|
|
|
}
|
2012-10-29 14:37:39 +01:00
|
|
|
}
|
2011-07-20 11:14:51 +03:00
|
|
|
}
|
|
|
|
|
}
|