Search in sources :

Example 6 with ReadData

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

the class ShardTransactionTest method testOnReceiveReadDataWhenDataNotFound.

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

        {
            testOnReceiveReadDataWhenDataNotFound(newTransactionActor(RO, readOnlyTransaction(), "testReadDataWhenDataNotFoundRO"));
            testOnReceiveReadDataWhenDataNotFound(newTransactionActor(RW, readWriteTransaction(), "testReadDataWhenDataNotFoundRW"));
        }

        private void testOnReceiveReadDataWhenDataNotFound(final ActorRef transaction) {
            transaction.tell(new ReadData(TestModel.TEST_PATH, DataStoreVersions.CURRENT_VERSION), getRef());
            ReadDataReply reply = expectMsgClass(duration("5 seconds"), ReadDataReply.class);
            assertTrue(reply.getNormalizedNode() == null);
        }
    };
}
Also used : ActorRef(akka.actor.ActorRef) TestActorRef(akka.testkit.TestActorRef) TestKit(akka.testkit.javadsl.TestKit) ReadDataReply(org.opendaylight.controller.cluster.datastore.messages.ReadDataReply) ReadData(org.opendaylight.controller.cluster.datastore.messages.ReadData) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)6 ReadData (org.opendaylight.controller.cluster.datastore.messages.ReadData)6 ActorRef (akka.actor.ActorRef)4 TestActorRef (akka.testkit.TestActorRef)4 ReadDataReply (org.opendaylight.controller.cluster.datastore.messages.ReadDataReply)3 Props (akka.actor.Props)2 TestKit (akka.testkit.javadsl.TestKit)2 YangInstanceIdentifier (org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier)2 LocalHistoryIdentifier (org.opendaylight.controller.cluster.access.concepts.LocalHistoryIdentifier)1 TransactionIdentifier (org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier)1 CanCommitTransaction (org.opendaylight.controller.cluster.datastore.messages.CanCommitTransaction)1 CanCommitTransactionReply (org.opendaylight.controller.cluster.datastore.messages.CanCommitTransactionReply)1 CommitTransaction (org.opendaylight.controller.cluster.datastore.messages.CommitTransaction)1 CreateTransaction (org.opendaylight.controller.cluster.datastore.messages.CreateTransaction)1 CreateTransactionReply (org.opendaylight.controller.cluster.datastore.messages.CreateTransactionReply)1 ContainerNode (org.opendaylight.yangtools.yang.data.api.schema.ContainerNode)1 NormalizedNode (org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)1 FiniteDuration (scala.concurrent.duration.FiniteDuration)1