Search in sources :

Example 11 with TestProbe

use of akka.testkit.TestProbe in project controller by opendaylight.

the class LocalReadOnlyProxyTransactionTest method testApplyModifyTransactionRequest.

@Test
public void testApplyModifyTransactionRequest() throws Exception {
    final TestProbe probe = createProbe();
    final ModifyTransactionRequestBuilder builder = new ModifyTransactionRequestBuilder(TRANSACTION_ID, probe.ref());
    builder.setSequence(0);
    builder.setAbort();
    final ModifyTransactionRequest request = builder.build();
    transaction.replayModifyTransactionRequest(request, createCallbackMock(), Ticker.systemTicker().read());
    getTester().expectTransactionRequest(AbortLocalTransactionRequest.class);
}
Also used : ModifyTransactionRequestBuilder(org.opendaylight.controller.cluster.access.commands.ModifyTransactionRequestBuilder) TestProbe(akka.testkit.TestProbe) ModifyTransactionRequest(org.opendaylight.controller.cluster.access.commands.ModifyTransactionRequest) Test(org.junit.Test)

Example 12 with TestProbe

use of akka.testkit.TestProbe in project controller by opendaylight.

the class LocalReadOnlyProxyTransactionTest method testApplyModifyTransactionRequestNotAbort.

@Test
public void testApplyModifyTransactionRequestNotAbort() throws Exception {
    final TestProbe probe = createProbe();
    final ModifyTransactionRequestBuilder builder = new ModifyTransactionRequestBuilder(TRANSACTION_ID, probe.ref());
    builder.setSequence(0);
    builder.setReady();
    final ModifyTransactionRequest request = builder.build();
    assertOperationThrowsException(() -> transaction.replayModifyTransactionRequest(request, createCallbackMock(), Ticker.systemTicker().read()), VerifyException.class);
}
Also used : ModifyTransactionRequestBuilder(org.opendaylight.controller.cluster.access.commands.ModifyTransactionRequestBuilder) TestProbe(akka.testkit.TestProbe) ModifyTransactionRequest(org.opendaylight.controller.cluster.access.commands.ModifyTransactionRequest) Test(org.junit.Test)

Example 13 with TestProbe

use of akka.testkit.TestProbe in project controller by opendaylight.

the class LocalReadWriteProxyTransactionTest method testHandleForwardedRemoteAbortRequest.

@Test
public void testHandleForwardedRemoteAbortRequest() throws Exception {
    final TestProbe probe = createProbe();
    final TransactionAbortRequest request = new TransactionAbortRequest(TRANSACTION_ID, 0L, probe.ref());
    testHandleForwardedRemoteRequest(request);
}
Also used : TransactionAbortRequest(org.opendaylight.controller.cluster.access.commands.TransactionAbortRequest) TestProbe(akka.testkit.TestProbe) Test(org.junit.Test)

Example 14 with TestProbe

use of akka.testkit.TestProbe in project controller by opendaylight.

the class LocalReadWriteProxyTransactionTest method testHandleForwardedRemotePreCommitRequest.

@Test
public void testHandleForwardedRemotePreCommitRequest() throws Exception {
    final TestProbe probe = createProbe();
    final TransactionPreCommitRequest request = new TransactionPreCommitRequest(TRANSACTION_ID, 0L, probe.ref());
    testHandleForwardedRemoteRequest(request);
}
Also used : TestProbe(akka.testkit.TestProbe) TransactionPreCommitRequest(org.opendaylight.controller.cluster.access.commands.TransactionPreCommitRequest) Test(org.junit.Test)

Example 15 with TestProbe

use of akka.testkit.TestProbe in project controller by opendaylight.

the class LocalReadWriteProxyTransactionTest method testHandleForwardedRemoteDoCommitRequest.

@Test
public void testHandleForwardedRemoteDoCommitRequest() throws Exception {
    final TestProbe probe = createProbe();
    final TransactionDoCommitRequest request = new TransactionDoCommitRequest(TRANSACTION_ID, 0L, probe.ref());
    testHandleForwardedRemoteRequest(request);
}
Also used : TransactionDoCommitRequest(org.opendaylight.controller.cluster.access.commands.TransactionDoCommitRequest) TestProbe(akka.testkit.TestProbe) Test(org.junit.Test)

Aggregations

TestProbe (akka.testkit.TestProbe)51 Test (org.junit.Test)30 Before (org.junit.Before)13 ModifyTransactionRequest (org.opendaylight.controller.cluster.access.commands.ModifyTransactionRequest)10 ClientActorContext (org.opendaylight.controller.cluster.access.client.ClientActorContext)8 ModifyTransactionRequestBuilder (org.opendaylight.controller.cluster.access.commands.ModifyTransactionRequestBuilder)7 Response (org.opendaylight.controller.cluster.access.concepts.Response)5 ActorContext (org.opendaylight.controller.cluster.datastore.utils.ActorContext)5 AbortLocalTransactionRequest (org.opendaylight.controller.cluster.access.commands.AbortLocalTransactionRequest)4 ConnectClientSuccess (org.opendaylight.controller.cluster.access.commands.ConnectClientSuccess)4 TransactionPurgeRequest (org.opendaylight.controller.cluster.access.commands.TransactionPurgeRequest)4 CursorAwareDataTreeModification (org.opendaylight.yangtools.yang.data.api.schema.tree.CursorAwareDataTreeModification)4 CommitLocalTransactionRequest (org.opendaylight.controller.cluster.access.commands.CommitLocalTransactionRequest)3 ExistsTransactionRequest (org.opendaylight.controller.cluster.access.commands.ExistsTransactionRequest)3 ReadTransactionRequest (org.opendaylight.controller.cluster.access.commands.ReadTransactionRequest)3 TransactionAbortRequest (org.opendaylight.controller.cluster.access.commands.TransactionAbortRequest)3 ActorRef (akka.actor.ActorRef)2 ArrayList (java.util.ArrayList)2 TransactionDoCommitRequest (org.opendaylight.controller.cluster.access.commands.TransactionDoCommitRequest)2 TransactionPreCommitRequest (org.opendaylight.controller.cluster.access.commands.TransactionPreCommitRequest)2