2012-01-20 14:29:50 +01:00
|
|
|
/**
|
|
|
|
|
* Copyright (C) 2009-2012 Typesafe Inc. <http://www.typesafe.com>
|
|
|
|
|
*/
|
2011-11-22 13:04:10 +01:00
|
|
|
package akka.remote
|
2011-07-20 11:14:51 +03:00
|
|
|
|
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-01-20 14:29:50 +01:00
|
|
|
import akka.util.duration._
|
2012-01-30 11:48:02 +01:00
|
|
|
import akka.util.Duration
|
|
|
|
|
import akka.remote.netty.NettyRemoteTransport
|
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(
|
|
|
|
|
"""
|
|
|
|
|
akka {
|
2012-02-02 11:46:52 +01:00
|
|
|
actor.provider = "akka.remote.RemoteActorRefProvider"
|
|
|
|
|
remote.netty.port = 0
|
2012-01-25 16:50:06 +01:00
|
|
|
}
|
|
|
|
|
""") {
|
2011-07-20 11:14:51 +03:00
|
|
|
|
2012-01-30 11:48:02 +01:00
|
|
|
"Remoting" must {
|
|
|
|
|
|
|
|
|
|
"be able to parse generic remote config elements" in {
|
2012-01-25 16:50:06 +01:00
|
|
|
val settings = system.asInstanceOf[ExtendedActorSystem].provider.asInstanceOf[RemoteActorRefProvider].remoteSettings
|
2012-01-20 14:29:50 +01:00
|
|
|
import settings._
|
|
|
|
|
|
|
|
|
|
RemoteTransport must be("akka.remote.netty.NettyRemoteTransport")
|
|
|
|
|
UntrustedMode must be(false)
|
|
|
|
|
RemoteSystemDaemonAckTimeout must be(30 seconds)
|
2011-07-20 11:14:51 +03:00
|
|
|
}
|
2012-01-30 11:48:02 +01:00
|
|
|
|
|
|
|
|
"be able to parse Netty config elements" in {
|
|
|
|
|
val settings =
|
|
|
|
|
system.asInstanceOf[ExtendedActorSystem]
|
|
|
|
|
.provider.asInstanceOf[RemoteActorRefProvider]
|
|
|
|
|
.transport.asInstanceOf[NettyRemoteTransport]
|
|
|
|
|
.settings
|
|
|
|
|
import settings._
|
|
|
|
|
|
|
|
|
|
BackoffTimeout must be(Duration.Zero)
|
|
|
|
|
SecureCookie must be(None)
|
|
|
|
|
RequireCookie must be(false)
|
|
|
|
|
UsePassiveConnections must be(true)
|
|
|
|
|
Hostname must not be "" // will be set to the local IP
|
2012-02-02 11:46:52 +01:00
|
|
|
PortSelector must be(0)
|
2012-01-30 11:48:02 +01:00
|
|
|
MessageFrameSize must be(1048576)
|
|
|
|
|
ConnectionTimeout must be(2 minutes)
|
|
|
|
|
Backlog must be(4096)
|
|
|
|
|
ExecutionPoolKeepalive must be(1 minute)
|
|
|
|
|
ExecutionPoolSize must be(4)
|
|
|
|
|
MaxChannelMemorySize must be(0)
|
|
|
|
|
MaxTotalMemorySize must be(0)
|
|
|
|
|
ReconnectDelay must be(5 seconds)
|
2012-02-01 16:06:30 +01:00
|
|
|
ReadTimeout must be(0 millis)
|
|
|
|
|
WriteTimeout must be(10 seconds)
|
|
|
|
|
AllTimeout must be(0 millis)
|
2012-01-30 11:48:02 +01:00
|
|
|
ReconnectionTimeWindow must be(10 minutes)
|
|
|
|
|
}
|
|
|
|
|
|
2011-07-20 11:14:51 +03:00
|
|
|
}
|
|
|
|
|
}
|