Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
BUG 2317 : StatisticsManager does not unregister from yang notifications on close
[controller.git]
/
opendaylight
/
md-sal
/
sal-akka-raft
/
src
/
test
/
java
/
org
/
opendaylight
/
controller
/
cluster
/
raft
/
behaviors
/
FollowerTest.java
diff --git
a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/FollowerTest.java
b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/FollowerTest.java
index a72a7c43324922748cad1837df047000cb1a4013..edeab11e2a6421cfdbafc7661ddca1e5b059ac7c 100644
(file)
--- a/
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/FollowerTest.java
+++ b/
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/FollowerTest.java
@@
-9,7
+9,6
@@
import org.junit.Test;
import org.opendaylight.controller.cluster.raft.DefaultConfigParamsImpl;
import org.opendaylight.controller.cluster.raft.MockRaftActorContext;
import org.opendaylight.controller.cluster.raft.RaftActorContext;
import org.opendaylight.controller.cluster.raft.DefaultConfigParamsImpl;
import org.opendaylight.controller.cluster.raft.MockRaftActorContext;
import org.opendaylight.controller.cluster.raft.RaftActorContext;
-import org.opendaylight.controller.cluster.raft.RaftState;
import org.opendaylight.controller.cluster.raft.ReplicatedLogEntry;
import org.opendaylight.controller.cluster.raft.base.messages.ApplySnapshot;
import org.opendaylight.controller.cluster.raft.base.messages.ElectionTimeout;
import org.opendaylight.controller.cluster.raft.ReplicatedLogEntry;
import org.opendaylight.controller.cluster.raft.base.messages.ApplySnapshot;
import org.opendaylight.controller.cluster.raft.base.messages.ElectionTimeout;
@@
-85,10
+84,10
@@
public class FollowerTest extends AbstractRaftActorBehaviorTest {
Follower follower =
new Follower(raftActorContext);
Follower follower =
new Follower(raftActorContext);
- Raft
State raftState
=
+ Raft
ActorBehavior raftBehavior
=
follower.handleMessage(followerActor, new ElectionTimeout());
follower.handleMessage(followerActor, new ElectionTimeout());
- Assert.assert
Equals(RaftState.Candidate, raftSt
ate);
+ Assert.assert
True(raftBehavior instanceof Candid
ate);
}
@Test
}
@Test
@@
-187,7
+186,7
@@
public class FollowerTest extends AbstractRaftActorBehaviorTest {
AppendEntries appendEntries =
new AppendEntries(2, "leader-1", 100, 1, entries, 101);
AppendEntries appendEntries =
new AppendEntries(2, "leader-1", 100, 1, entries, 101);
- Raft
State raftState
=
+ Raft
ActorBehavior raftBehavior
=
createBehavior(context).handleMessage(getRef(), appendEntries);
assertEquals(101L, context.getLastApplied());
createBehavior(context).handleMessage(getRef(), appendEntries);
assertEquals(101L, context.getLastApplied());
@@
-226,12
+225,12
@@
public class FollowerTest extends AbstractRaftActorBehaviorTest {
RaftActorBehavior behavior = createBehavior(context);
// Send an unknown message so that the state of the RaftActor remains unchanged
RaftActorBehavior behavior = createBehavior(context);
// Send an unknown message so that the state of the RaftActor remains unchanged
- Raft
State
expected = behavior.handleMessage(getRef(), "unknown");
+ Raft
ActorBehavior
expected = behavior.handleMessage(getRef(), "unknown");
- Raft
State raftState
=
+ Raft
ActorBehavior raftBehavior
=
behavior.handleMessage(getRef(), appendEntries);
behavior.handleMessage(getRef(), appendEntries);
- assertEquals(expected, raft
State
);
+ assertEquals(expected, raft
Behavior
);
// Also expect an AppendEntriesReply to be sent where success is false
final Boolean out = new ExpectMsg<Boolean>(duration("1 seconds"),
// Also expect an AppendEntriesReply to be sent where success is false
final Boolean out = new ExpectMsg<Boolean>(duration("1 seconds"),
@@
-302,12
+301,12
@@
public class FollowerTest extends AbstractRaftActorBehaviorTest {
RaftActorBehavior behavior = createBehavior(context);
// Send an unknown message so that the state of the RaftActor remains unchanged
RaftActorBehavior behavior = createBehavior(context);
// Send an unknown message so that the state of the RaftActor remains unchanged
- Raft
State
expected = behavior.handleMessage(getRef(), "unknown");
+ Raft
ActorBehavior
expected = behavior.handleMessage(getRef(), "unknown");
- Raft
State raftState
=
+ Raft
ActorBehavior raftBehavior
=
behavior.handleMessage(getRef(), appendEntries);
behavior.handleMessage(getRef(), appendEntries);
- assertEquals(expected, raft
State
);
+ assertEquals(expected, raft
Behavior
);
assertEquals(5, log.last().getIndex() + 1);
assertNotNull(log.get(3));
assertNotNull(log.get(4));
assertEquals(5, log.last().getIndex() + 1);
assertNotNull(log.get(3));
assertNotNull(log.get(4));
@@
-382,12
+381,12
@@
public class FollowerTest extends AbstractRaftActorBehaviorTest {
RaftActorBehavior behavior = createBehavior(context);
// Send an unknown message so that the state of the RaftActor remains unchanged
RaftActorBehavior behavior = createBehavior(context);
// Send an unknown message so that the state of the RaftActor remains unchanged
- Raft
State
expected = behavior.handleMessage(getRef(), "unknown");
+ Raft
ActorBehavior
expected = behavior.handleMessage(getRef(), "unknown");
- Raft
State raftState
=
+ Raft
ActorBehavior raftBehavior
=
behavior.handleMessage(getRef(), appendEntries);
behavior.handleMessage(getRef(), appendEntries);
- assertEquals(expected, raft
State
);
+ assertEquals(expected, raft
Behavior
);
// The entry at index 2 will be found out-of-sync with the leader
// and will be removed
// The entry at index 2 will be found out-of-sync with the leader
// and will be removed