Factor out localhost and re-enable schoir.

This commit is contained in:
Eugene Vigdorchik 2012-01-25 20:12:26 +04:00
parent 7f3a9cd756
commit c8cd25e913
8 changed files with 27 additions and 24 deletions

View file

@ -6,14 +6,15 @@ trait AbstractRemoteActorMultiJvmSpec {
def NrOfNodes: Int
def commonConfig: Config
def remotes: Seq[String] = {
private[this] val remotes: Array[String] = {
val arrayOpt = Option(AkkaRemoteSpec.testNodes).map(_ split ",")
(arrayOpt getOrElse Array.fill(NrOfNodes)("localhost")).toSeq
(arrayOpt getOrElse Array.fill(NrOfNodes)("localhost")).toArray
}
def specString(count: Int): String = {
val specs = for ((host, idx) <- remotes.take(count).zipWithIndex) yield
"\"akka://AkkaRemoteSpec@%s:%d\"".format(host, 9991+idx)
def akkaSpec(idx: Int) = "AkkaRemoteSpec@%s:%d".format(remotes(idx), 9991+idx)
def akkaURIs(count: Int): String = {
val specs = for (idx <- 0 until count) yield "\"akka://" + akkaSpec(idx) + "\""
specs.mkString(",")
}