use of akka.testkit.TestProbe in project controller by opendaylight.
the class LocalProxyTransactionTest method testForwardToLocalAbort.
@Test
public void testForwardToLocalAbort() throws Exception {
final TestProbe probe = createProbe();
final AbortLocalTransactionRequest request = new AbortLocalTransactionRequest(TRANSACTION_ID, probe.ref());
testForwardToLocal(request, AbortLocalTransactionRequest.class);
}
use of akka.testkit.TestProbe in project controller by opendaylight.
the class LocalProxyTransactionTest method testHandleForwardedRemoteExistsRequest.
@Test
public void testHandleForwardedRemoteExistsRequest() throws Exception {
final TestProbe probe = createProbe();
final ExistsTransactionRequest request = new ExistsTransactionRequest(TRANSACTION_ID, 0L, probe.ref(), PATH_1, true);
final Consumer<Response<?, ?>> callback = createCallbackMock();
setupExecuteInActor();
transaction.handleReplayedRemoteRequest(request, callback, Ticker.systemTicker().read());
final ArgumentCaptor<Response> captor = ArgumentCaptor.forClass(Response.class);
verify(callback).accept(captor.capture());
final Response<?, ?> value = captor.getValue();
Assert.assertTrue(value instanceof ExistsTransactionSuccess);
final ExistsTransactionSuccess success = (ExistsTransactionSuccess) value;
Assert.assertTrue(success.getExists());
}
use of akka.testkit.TestProbe in project controller by opendaylight.
the class LocalProxyTransactionTest method testHandleForwardedRemotePurgeRequest.
@Test
public void testHandleForwardedRemotePurgeRequest() throws Exception {
final TestProbe probe = createProbe();
final TransactionPurgeRequest request = new TransactionPurgeRequest(TRANSACTION_ID, 0L, probe.ref());
testHandleForwardedRemoteRequest(request);
}
use of akka.testkit.TestProbe in project controller by opendaylight.
the class LocalReadWriteProxyTransactionTest method testSendAbort.
@Test
public void testSendAbort() throws Exception {
final TestProbe probe = createProbe();
final TransactionRequest<?> request = new AbortLocalTransactionRequest(TRANSACTION_ID, probe.ref());
transaction.sendAbort(request, createCallbackMock());
assertOperationThrowsException(() -> transaction.delete(PATH_1), IllegalStateException.class);
}
use of akka.testkit.TestProbe in project controller by opendaylight.
the class LocalReadWriteProxyTransactionTest method testForwardToLocalCommit.
@Test
public void testForwardToLocalCommit() throws Exception {
final TestProbe probe = createProbe();
final DataTreeModification mod = mock(DataTreeModification.class);
final TransactionRequest<?> request = new CommitLocalTransactionRequest(TRANSACTION_ID, 0L, probe.ref(), mod, null, false);
testForwardToLocal(request, CommitLocalTransactionRequest.class);
}
Aggregations