Search in sources :

Example 21 with TestProbe

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

the class RemoteProxyTransactionTest method testForwardToRemoteCommit.

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

Example 22 with TestProbe

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

the class SingleClientHistoryTest method setUp.

@Before
public void setUp() throws Exception {
    MockitoAnnotations.initMocks(this);
    system = ActorSystem.apply();
    final TestProbe clientContextProbe = new TestProbe(system, "client");
    final TestProbe actorContextProbe = new TestProbe(system, "actor-context");
    clientActorContext = AccessClientUtil.createClientActorContext(system, clientContextProbe.ref(), CLIENT_ID, PERSISTENCE_ID);
    final ActorContext actorContextMock = createActorContextMock(system, actorContextProbe.ref());
    behavior = new SimpleDataStoreClientBehavior(clientActorContext, actorContextMock, SHARD_NAME);
    object = new SingleClientHistory(behavior, HISTORY_ID);
}
Also used : TestProbe(akka.testkit.TestProbe) ClientActorContext(org.opendaylight.controller.cluster.access.client.ClientActorContext) ActorContext(org.opendaylight.controller.cluster.datastore.utils.ActorContext) Before(org.junit.Before)

Example 23 with TestProbe

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

the class RoleChangeNotifierTest method checkListenerRoleChangeNotification.

private void checkListenerRoleChangeNotification(final RoleChanged roleChanged) {
    for (final TestProbe listener : listeners) {
        final RoleChangeNotification received = listener.expectMsgClass(RoleChangeNotification.class);
        Assert.assertEquals(roleChanged.getMemberId(), received.getMemberId());
        Assert.assertEquals(roleChanged.getOldRole(), received.getOldRole());
        Assert.assertEquals(roleChanged.getNewRole(), received.getNewRole());
    }
}
Also used : TestProbe(akka.testkit.TestProbe)

Example 24 with TestProbe

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

the class RoleChangeNotifierTest method registerListeners.

private void registerListeners() {
    for (final TestProbe listener : listeners) {
        notifier.tell(new RegisterRoleChangeListener(), listener.ref());
        listener.expectMsgClass(RegisterRoleChangeListenerReply.class);
    }
}
Also used : TestProbe(akka.testkit.TestProbe)

Example 25 with TestProbe

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

the class AbstractTransmitQueueTest method setUp.

@Before
public void setUp() throws Exception {
    system = ActorSystem.apply();
    probe = new TestProbe(system);
    queue = createQueue();
}
Also used : TestProbe(akka.testkit.TestProbe) Before(org.junit.Before)

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