use of akka.testkit.TestProbe in project controller by opendaylight.
the class RemoteProxyTransactionTest method testForwardToRemoteModifyExists.
@Test
public void testForwardToRemoteModifyExists() throws Exception {
final TestProbe probe = createProbe();
final ExistsTransactionRequest request = new ExistsTransactionRequest(TRANSACTION_ID, 0L, probe.ref(), PATH_1, false);
final ExistsTransactionRequest received = testForwardToRemote(request, ExistsTransactionRequest.class);
Assert.assertEquals(request.getTarget(), received.getTarget());
Assert.assertEquals(request.getPath(), received.getPath());
}
use of akka.testkit.TestProbe in project controller by opendaylight.
the class RemoteProxyTransactionTest method testForwardToRemoteModifyCommitSimple.
@Test
public void testForwardToRemoteModifyCommitSimple() throws Exception {
final TestProbe probe = createProbe();
final ModifyTransactionRequestBuilder builder = new ModifyTransactionRequestBuilder(TRANSACTION_ID, probe.ref());
builder.setSequence(0L);
builder.setCommit(false);
final ModifyTransactionRequest request = builder.build();
final ModifyTransactionRequest received = testForwardToRemote(request, ModifyTransactionRequest.class);
Assert.assertEquals(request.getPersistenceProtocol(), received.getPersistenceProtocol());
Assert.assertEquals(request.getModifications(), received.getModifications());
Assert.assertEquals(request.getTarget(), received.getTarget());
}
use of akka.testkit.TestProbe in project controller by opendaylight.
the class RemoteProxyTransactionTest method testForwardToRemoteModifyCommit3Phase.
@Test
public void testForwardToRemoteModifyCommit3Phase() throws Exception {
final TestProbe probe = createProbe();
final ModifyTransactionRequestBuilder builder = new ModifyTransactionRequestBuilder(TRANSACTION_ID, probe.ref());
builder.setSequence(0L);
builder.setCommit(true);
final ModifyTransactionRequest request = builder.build();
final ModifyTransactionRequest received = testForwardToRemote(request, ModifyTransactionRequest.class);
Assert.assertEquals(request.getPersistenceProtocol(), received.getPersistenceProtocol());
Assert.assertEquals(request.getModifications(), received.getModifications());
Assert.assertEquals(request.getTarget(), received.getTarget());
}
use of akka.testkit.TestProbe in project controller by opendaylight.
the class RoleChangeNotifierTest method setUp.
@Before
public void setUp() throws Exception {
system = ActorSystem.apply();
notifier = system.actorOf(RoleChangeNotifier.getProps(MEMBER_ID));
listeners = new ArrayList<>(LISTENER_COUNT);
for (int i = 0; i < LISTENER_COUNT; i++) {
listeners.add(new TestProbe(system));
}
}
use of akka.testkit.TestProbe in project controller by opendaylight.
the class RoleChangeNotifierTest method checkListenerLeaderStateChanged.
private void checkListenerLeaderStateChanged(final LeaderStateChanged leaderStateChanged) {
for (final TestProbe listener : listeners) {
final LeaderStateChanged received = listener.expectMsgClass(LeaderStateChanged.class);
Assert.assertEquals(leaderStateChanged.getMemberId(), received.getMemberId());
Assert.assertEquals(leaderStateChanged.getLeaderId(), received.getLeaderId());
Assert.assertEquals(leaderStateChanged.getLeaderPayloadVersion(), received.getLeaderPayloadVersion());
}
}
Aggregations