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 7362: Notify applyState synchronously
[controller.git]
/
opendaylight
/
md-sal
/
sal-akka-raft
/
src
/
test
/
java
/
org
/
opendaylight
/
controller
/
cluster
/
raft
/
RaftActorServerConfigurationSupportTest.java
diff --git
a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorServerConfigurationSupportTest.java
b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorServerConfigurationSupportTest.java
index 43ad1c1ca5aa7d8b521898119cd975a4a935eb49..a19281ffd8cbedd86062c008edd65cc6c2bbb8f4 100644
(file)
--- a/
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorServerConfigurationSupportTest.java
+++ b/
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorServerConfigurationSupportTest.java
@@
-204,9
+204,6
@@
public class RaftActorServerConfigurationSupportTest extends AbstractActorTest {
assertEquals("New follower peers", Sets.newHashSet(LEADER_ID, FOLLOWER_ID),
newFollowerActorContext.getPeerIds());
assertEquals("New follower peers", Sets.newHashSet(LEADER_ID, FOLLOWER_ID),
newFollowerActorContext.getPeerIds());
- expectFirstMatching(newFollowerCollectorActor, ApplyState.class);
- expectFirstMatching(followerActor, ApplyState.class);
-
assertEquals("Follower commit index", 3, followerActorContext.getCommitIndex());
assertEquals("Follower last applied index", 3, followerActorContext.getLastApplied());
assertEquals("New follower commit index", 3, newFollowerActorContext.getCommitIndex());
assertEquals("Follower commit index", 3, followerActorContext.getCommitIndex());
assertEquals("Follower last applied index", 3, followerActorContext.getLastApplied());
assertEquals("New follower commit index", 3, newFollowerActorContext.getCommitIndex());
@@
-768,12
+765,12
@@
public class RaftActorServerConfigurationSupportTest extends AbstractActorTest {
RaftActorServerConfigurationSupport support = new RaftActorServerConfigurationSupport(
noLeaderActor.underlyingActor());
RaftActorServerConfigurationSupport support = new RaftActorServerConfigurationSupport(
noLeaderActor.underlyingActor());
- ReplicatedLogEntry serverConfigEntry = new
MockRaftActorContext.Mock
ReplicatedLogEntry(1, 1,
+ ReplicatedLogEntry serverConfigEntry = new
Simple
ReplicatedLogEntry(1, 1,
new ServerConfigurationPayload(Collections.<ServerInfo>emptyList()));
boolean handled = support.handleMessage(new ApplyState(null, null, serverConfigEntry), ActorRef.noSender());
assertEquals("Message handled", true, handled);
new ServerConfigurationPayload(Collections.<ServerInfo>emptyList()));
boolean handled = support.handleMessage(new ApplyState(null, null, serverConfigEntry), ActorRef.noSender());
assertEquals("Message handled", true, handled);
- ReplicatedLogEntry nonServerConfigEntry = new
MockRaftActorContext.Mock
ReplicatedLogEntry(1, 1,
+ ReplicatedLogEntry nonServerConfigEntry = new
Simple
ReplicatedLogEntry(1, 1,
new MockRaftActorContext.MockPayload("1"));
handled = support.handleMessage(new ApplyState(null, null, nonServerConfigEntry), ActorRef.noSender());
assertEquals("Message handled", false, handled);
new MockRaftActorContext.MockPayload("1"));
handled = support.handleMessage(new ApplyState(null, null, nonServerConfigEntry), ActorRef.noSender());
assertEquals("Message handled", false, handled);
@@
-1479,7
+1476,8
@@
public class RaftActorServerConfigurationSupportTest extends AbstractActorTest {
ElectionTermImpl termInfo = new ElectionTermImpl(noPersistence, id, LOG);
termInfo.update(1, LEADER_ID);
return new RaftActorContextImpl(actor, actor.underlyingActor().getContext(),
ElectionTermImpl termInfo = new ElectionTermImpl(noPersistence, id, LOG);
termInfo.update(1, LEADER_ID);
return new RaftActorContextImpl(actor, actor.underlyingActor().getContext(),
- id, termInfo, -1, -1, ImmutableMap.of(LEADER_ID, ""), configParams, noPersistence, LOG);
+ id, termInfo, -1, -1, ImmutableMap.of(LEADER_ID, ""), configParams,
+ noPersistence, applyState -> actor.tell(applyState, actor), LOG);
}
abstract static class AbstractMockRaftActor extends MockRaftActor {
}
abstract static class AbstractMockRaftActor extends MockRaftActor {