Search in sources :

Example 6 with ClientActorContext

use of org.opendaylight.controller.cluster.access.client.ClientActorContext 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 7 with ClientActorContext

use of org.opendaylight.controller.cluster.access.client.ClientActorContext in project controller by opendaylight.

the class ClientTransactionCommitCohortTest method setUp.

@Before
public void setUp() throws Exception {
    MockitoAnnotations.initMocks(this);
    system = ActorSystem.apply();
    final TestProbe clientContextProbe = new TestProbe(system, "clientContext");
    final ClientActorContext context = AccessClientUtil.createClientActorContext(system, clientContextProbe.ref(), CLIENT_ID, PERSISTENCE_ID);
    transactions = new ArrayList<>();
    for (int i = 0; i < TRANSACTIONS; i++) {
        transactions.add(createTransactionTester(new TestProbe(system, "backend" + i), context, history));
    }
    final Collection<AbstractProxyTransaction> proxies = transactions.stream().map(TransactionTester::getTransaction).collect(Collectors.toList());
    proxies.forEach(AbstractProxyTransaction::seal);
    cohort = new ClientTransactionCommitCohort(history, TRANSACTION_ID, proxies);
}
Also used : TestProbe(akka.testkit.TestProbe) ClientActorContext(org.opendaylight.controller.cluster.access.client.ClientActorContext) Before(org.junit.Before)

Aggregations

TestProbe (akka.testkit.TestProbe)7 ClientActorContext (org.opendaylight.controller.cluster.access.client.ClientActorContext)7 Before (org.junit.Before)5 ActorContext (org.opendaylight.controller.cluster.datastore.utils.ActorContext)3 ConnectClientSuccess (org.opendaylight.controller.cluster.access.commands.ConnectClientSuccess)1 CursorAwareDataTreeModification (org.opendaylight.yangtools.yang.data.api.schema.tree.CursorAwareDataTreeModification)1 DataTreeSnapshot (org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeSnapshot)1