Refactor LeaderTest 08/15208/3
authortpantelis <tpanteli@brocade.com>
Tue, 10 Feb 2015 13:15:07 +0000 (08:15 -0500)
committertpantelis <tpanteli@brocade.com>
Wed, 18 Feb 2015 02:47:17 +0000 (21:47 -0500)
commit03e752cbd625921ece92c5281cd4e1a8c81b3210
tree920edd46cd1c64c1276aceaa427bef8218bc290e
parent766613c8c5cbfe2e790e6d7b4531227899e84f2c
Refactor LeaderTest

Removed the remaining Within blocks in tests.

Changed each test to use the leaderActor and followerActor class members for
consistency. The actors are killed on tearDown. The creation of a
JavaTestKit block is no longer necessary and was removed from each test.

Added a shorcut method createActorContextWithFollower that creates the
leader context and adds a peer follower. This eliminates some duplicate code
in the tests.

Added an expectFirstMatching method to MessageCollector that waits for
the message in contrast to getFirstMatching.

Added some more assertions in some tests.

Change-Id: Id4ee0291352999b31e40abd9895e3d0237acf432
Signed-off-by: tpantelis <tpanteli@brocade.com>
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/FollowerLogInformationImpl.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/MockRaftActorContext.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorTest.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/TestActorFactory.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractRaftActorBehaviorTest.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/CandidateTest.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/FollowerTest.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/IsolatedLeaderTest.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/LeaderTest.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/utils/MessageCollectorActor.java

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.