Created FailureDetectorStrategy with two implementations: FailureDetectorPuppetStrategy and AccrualFailureDetectorStrategy.

- Created FailureDetectorStrategy base trait.
- Created FailureDetectorPuppetStrategy.
- Created AccrualFailureDetectorStrategy.
- Created two versions of LeaderDowningNodeThatIsUnreachableMultiJvmSpec
    - LeaderDowningNodeThatIsUnreachableWithFailureDetectorPuppet
    - LeaderDowningNodeThatIsUnreachableWithAccrualFailureDetector
- Added AccrualFailureDetectorStrategy to all the remaining tests - will be split up into two versions shortly.

Signed-off-by: Jonas Bonér <jonas@jonasboner.com>
This commit is contained in:
Jonas Bonér 2012-06-11 14:32:17 +02:00
parent 523f433e4b
commit b65cf5c2ec
23 changed files with 149 additions and 86 deletions

View file

@ -5,7 +5,7 @@ package akka.cluster
import com.typesafe.config.Config
import com.typesafe.config.ConfigFactory
import akka.actor.Address
import akka.actor.{Address, ExtendedActorSystem}
import akka.remote.testconductor.RoleName
import akka.remote.testkit.MultiNodeSpec
import akka.testkit._
@ -28,14 +28,19 @@ object MultiNodeClusterSpec {
""")
}
trait MultiNodeClusterSpec { self: MultiNodeSpec
trait MultiNodeClusterSpec extends FailureDetectorStrategy { self: MultiNodeSpec
override def initialParticipants = roles.size
/**
* Get or create a cluster node using 'Cluster(system)' extension.
* The cluster node instance. Needs to be lazily created.
*/
def cluster: Cluster = Cluster(system)
private lazy val clusterNode = new Cluster(system.asInstanceOf[ExtendedActorSystem], failureDetector)
/**
* Get the cluster node to use.
*/
def cluster: Cluster = clusterNode
/**
* Use this method instead of 'cluster.self'
@ -48,9 +53,7 @@ trait MultiNodeClusterSpec { self: MultiNodeSpec ⇒
* nodes (roles). First node will be started first
* and others will join the first.
*/
def startCluster(roles: RoleName*): Unit = {
awaitStartCluster(false, roles.toSeq)
}
def startCluster(roles: RoleName*): Unit = awaitStartCluster(false, roles.toSeq)
/**
* Initialize the cluster of the specified member