Search in sources :

Example 1 with QueueKey

use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.queues.QueueKey in project openflowplugin by opendaylight.

the class StatisticsGatheringUtilsTest method testGatherStatistics_queue.

@Test
public void testGatherStatistics_queue() throws Exception {
    final MultipartType type = MultipartType.OFPMPQUEUE;
    final long queueIdValue = 4L;
    final QueueStatsBuilder queueStatsBld = new QueueStatsBuilder().setPortNo(11L).setTxBytes(BigInteger.valueOf(44L)).setTxErrors(BigInteger.valueOf(45L)).setTxPackets(BigInteger.valueOf(46L)).setDurationSec(47L).setDurationNsec(48L).setQueueId(queueIdValue);
    final MultipartReplyQueueBuilder mpReplyQueueBld = new MultipartReplyQueueBuilder();
    mpReplyQueueBld.setQueueStats(Lists.newArrayList(queueStatsBld.build()));
    final MultipartReplyQueueCaseBuilder mpReplyQueueCaseBld = new MultipartReplyQueueCaseBuilder();
    mpReplyQueueCaseBld.setMultipartReplyQueue(mpReplyQueueBld.build());
    final MultipartReply meterStatsUpdated = assembleMPReplyMessage(type, mpReplyQueueCaseBld.build());
    final List<MultipartReply> statsData = Collections.singletonList(meterStatsUpdated);
    fireAndCheck(type, statsData);
    final KeyedInstanceIdentifier<Queue, QueueKey> queuePath = dummyNodePath.child(NodeConnector.class, new NodeConnectorKey(new NodeConnectorId("openflow:" + DUMMY_NODE_ID_VALUE + ":11"))).augmentation(FlowCapableNodeConnector.class).child(Queue.class, new QueueKey(new QueueId(queueIdValue)));
    verify(deviceContext).writeToTransaction(Matchers.eq(LogicalDatastoreType.OPERATIONAL), Matchers.eq(queuePath), Matchers.any(Queue.class));
}
Also used : MultipartType(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType) MultipartReply(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReply) NodeConnectorId(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId) QueueId(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.queue.rev130925.QueueId) MultipartReplyQueueBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.queue._case.MultipartReplyQueueBuilder) FlowCapableNodeConnector(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector) MultipartReplyQueueCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.MultipartReplyQueueCaseBuilder) QueueStatsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.queue._case.multipart.reply.queue.QueueStatsBuilder) Queue(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.queues.Queue) NodeConnectorKey(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey) QueueKey(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.queues.QueueKey) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 FlowCapableNodeConnector (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector)1 Queue (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.queues.Queue)1 QueueKey (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.queues.QueueKey)1 QueueId (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.queue.rev130925.QueueId)1 NodeConnectorId (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId)1 NodeConnectorKey (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey)1 MultipartType (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType)1 MultipartReply (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReply)1 MultipartReplyQueueCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.MultipartReplyQueueCaseBuilder)1 MultipartReplyQueueBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.queue._case.MultipartReplyQueueBuilder)1 QueueStatsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.queue._case.multipart.reply.queue.QueueStatsBuilder)1