Add missing CurrentClusterState case to tests, see #2456

* The only reason I can think of why the MemberExited event
  isn't received in MembershipChangeListenerExitingSpec is that
  CurrentClusterState isn't handled. Might be something else
  but this was wrong anyway.
This commit is contained in:
Patrik Nordwall 2012-08-30 16:54:55 +02:00
parent 8ba0041e7c
commit bb9fad1d0b
4 changed files with 21 additions and 1 deletions

View file

@ -11,6 +11,7 @@ import akka.testkit._
import scala.concurrent.util.duration._
import akka.actor.Props
import akka.actor.Actor
import akka.cluster.MemberStatus._
object NodeLeavingAndExitingMultiJvmSpec extends MultiNodeConfig {
val first = role("first")
@ -48,6 +49,11 @@ abstract class NodeLeavingAndExitingSpec
val exitingLatch = TestLatch()
cluster.subscribe(system.actorOf(Props(new Actor {
def receive = {
case state: CurrentClusterState
if (state.members.exists(m m.address == secondAddess && m.status == Leaving))
leavingLatch.countDown()
if (state.members.exists(m m.address == secondAddess && m.status == Exiting))
exitingLatch.countDown()
case MemberLeft(m) if m.address == secondAddess leavingLatch.countDown()
case MemberExited(m) if m.address == secondAddess exitingLatch.countDown()