pekko/akka-docs/rst/scala/code/docs/cluster/ClusterDocSpec.scala
2017-01-04 17:37:15 +01:00

27 lines
484 B
Scala

/**
* Copyright (C) 2015-2017 Lightbend Inc. <http://www.lightbend.com>
*/
package docs.cluster
import akka.cluster.Cluster
import akka.testkit.AkkaSpec
object ClusterDocSpec {
val config =
"""
akka.actor.provider = "cluster"
akka.remote.netty.tcp.port = 0
"""
}
class ClusterDocSpec extends AkkaSpec(ClusterDocSpec.config) {
"demonstrate leave" in {
//#leave
val cluster = Cluster(system)
cluster.leave(cluster.selfAddress)
//#leave
}
}