Search in sources :

Example 1 with CloseTransaction

use of org.opendaylight.controller.cluster.datastore.messages.CloseTransaction in project controller by opendaylight.

the class ShardTransactionTest method testReadWriteTxOnReceiveCloseTransaction.

@Test
public void testReadWriteTxOnReceiveCloseTransaction() throws Exception {
    new TestKit(getSystem()) {

        {
            final ActorRef transaction = newTransactionActor(RW, readWriteTransaction(), "testReadWriteTxOnReceiveCloseTransaction");
            watch(transaction);
            transaction.tell(new CloseTransaction().toSerializable(), getRef());
            expectMsgClass(duration("3 seconds"), CloseTransactionReply.class);
            expectTerminated(duration("3 seconds"), transaction);
        }
    };
}
Also used : CloseTransaction(org.opendaylight.controller.cluster.datastore.messages.CloseTransaction) ActorRef(akka.actor.ActorRef) TestActorRef(akka.testkit.TestActorRef) TestKit(akka.testkit.javadsl.TestKit) Test(org.junit.Test)

Example 2 with CloseTransaction

use of org.opendaylight.controller.cluster.datastore.messages.CloseTransaction in project controller by opendaylight.

the class ShardTransactionTest method testWriteOnlyTxOnReceiveCloseTransaction.

@Test
public void testWriteOnlyTxOnReceiveCloseTransaction() throws Exception {
    new TestKit(getSystem()) {

        {
            final ActorRef transaction = newTransactionActor(WO, readWriteTransaction(), "testWriteTxOnReceiveCloseTransaction");
            watch(transaction);
            transaction.tell(new CloseTransaction().toSerializable(), getRef());
            expectMsgClass(duration("3 seconds"), CloseTransactionReply.class);
            expectTerminated(duration("3 seconds"), transaction);
        }
    };
}
Also used : CloseTransaction(org.opendaylight.controller.cluster.datastore.messages.CloseTransaction) ActorRef(akka.actor.ActorRef) TestActorRef(akka.testkit.TestActorRef) TestKit(akka.testkit.javadsl.TestKit) Test(org.junit.Test)

Example 3 with CloseTransaction

use of org.opendaylight.controller.cluster.datastore.messages.CloseTransaction in project controller by opendaylight.

the class ShardTransactionTest method testReadOnlyTxOnReceiveCloseTransaction.

@Test
public void testReadOnlyTxOnReceiveCloseTransaction() throws Exception {
    new TestKit(getSystem()) {

        {
            final ActorRef transaction = newTransactionActor(TransactionType.READ_ONLY, readOnlyTransaction(), "testReadOnlyTxOnReceiveCloseTransaction");
            watch(transaction);
            transaction.tell(new CloseTransaction().toSerializable(), getRef());
            expectMsgClass(duration("3 seconds"), Terminated.class);
        }
    };
}
Also used : CloseTransaction(org.opendaylight.controller.cluster.datastore.messages.CloseTransaction) ActorRef(akka.actor.ActorRef) TestActorRef(akka.testkit.TestActorRef) TestKit(akka.testkit.javadsl.TestKit) Test(org.junit.Test)

Aggregations

ActorRef (akka.actor.ActorRef)3 TestActorRef (akka.testkit.TestActorRef)3 TestKit (akka.testkit.javadsl.TestKit)3 Test (org.junit.Test)3 CloseTransaction (org.opendaylight.controller.cluster.datastore.messages.CloseTransaction)3