Search in sources :

Example 21 with QueueId

use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.queue.rev130925.QueueId in project openflowplugin by opendaylight.

the class OF10QueueGetConfigReplyMessageFactoryTest method createQueues.

private List<Queues> createQueues() {
    List<Queues> list = new ArrayList<>();
    QueuesBuilder builder = new QueuesBuilder();
    builder.setQueueId(new QueueId(1L));
    builder.setQueueProperty(createPropertiesList());
    list.add(builder.build());
    return list;
}
Also used : ArrayList(java.util.ArrayList) QueueId(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.QueueId) Queues(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.get.config.reply.Queues) QueuesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.get.config.reply.QueuesBuilder)

Example 22 with QueueId

use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.queue.rev130925.QueueId in project openflowplugin by opendaylight.

the class SetQueueActionDeserializerTest method testDeserialize.

@Test
public void testDeserialize() throws Exception {
    final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
    final int queueId = 10;
    writeHeader(in);
    in.writeInt(queueId);
    final Action action = deserializeAction(in);
    assertTrue(SetQueueActionCase.class.isInstance(action));
    assertEquals(queueId, SetQueueActionCase.class.cast(action).getSetQueueAction().getQueueId().intValue());
    assertEquals(0, in.readableBytes());
}
Also used : Action(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action) ByteBuf(io.netty.buffer.ByteBuf) SetQueueActionCase(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetQueueActionCase) Test(org.junit.Test)

Example 23 with QueueId

use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.queue.rev130925.QueueId in project openflowplugin by opendaylight.

the class QueueDirectStatisticsServiceTest method testStoreStatistics.

@Override
public void testStoreStatistics() throws Exception {
    final QueueIdAndStatisticsMap map = mock(QueueIdAndStatisticsMap.class);
    when(map.getQueueId()).thenReturn(new QueueId(QUEUE_NO));
    final List<QueueIdAndStatisticsMap> maps = Collections.singletonList(map);
    final GetQueueStatisticsOutput output = mock(GetQueueStatisticsOutput.class);
    when(output.getQueueIdAndStatisticsMap()).thenReturn(maps);
    multipartWriterProvider.lookup(MultipartType.OFPMPQUEUE).get().write(output, true);
    verify(deviceContext).writeToTransactionWithParentsSlow(eq(LogicalDatastoreType.OPERATIONAL), any(), any());
}
Also used : QueueIdAndStatisticsMap(org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.queue.id.and.statistics.map.QueueIdAndStatisticsMap) GetQueueStatisticsOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetQueueStatisticsOutput) QueueId(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.queue.rev130925.QueueId)

Example 24 with QueueId

use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.queue.rev130925.QueueId in project openflowplugin by opendaylight.

the class QueueDirectStatisticsServiceTest method testBuildRequestBody.

@Override
public void testBuildRequestBody() throws Exception {
    final GetQueueStatisticsInput input = mock(GetQueueStatisticsInput.class);
    when(input.getNode()).thenReturn(createNodeRef(NODE_ID));
    when(input.getQueueId()).thenReturn(new QueueId(QUEUE_NO));
    when(input.getNodeConnectorId()).thenReturn(nodeConnectorId);
    final MultipartRequestQueueStats body = (MultipartRequestQueueStats) ((MultipartRequest) service.buildRequest(new Xid(42L), input)).getMultipartRequestBody();
    assertEquals(nodeConnectorId, body.getNodeConnectorId());
    assertEquals(QUEUE_NO, body.getQueueId().getValue());
}
Also used : Xid(org.opendaylight.openflowplugin.api.openflow.device.Xid) MultipartRequestQueueStats(org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.multipart.request.multipart.request.body.MultipartRequestQueueStats) QueueId(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.queue.rev130925.QueueId) GetQueueStatisticsInput(org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetQueueStatisticsInput)

Aggregations

QueueId (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.queue.rev130925.QueueId)11 ArrayList (java.util.ArrayList)10 Test (org.junit.Test)8 QueueId (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.QueueId)8 Queues (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.get.config.reply.Queues)7 ByteBuf (io.netty.buffer.ByteBuf)6 NodeConnectorId (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId)6 PortNumber (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber)6 QueuesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.get.config.reply.QueuesBuilder)6 QueueIdAndStatisticsMap (org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.queue.id.and.statistics.map.QueueIdAndStatisticsMap)6 Counter64 (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter64)5 MultipartReplyQueueCase (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.MultipartReplyQueueCase)5 MultipartReplyQueue (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.queue._case.MultipartReplyQueue)5 QueueIdAndStatisticsMapBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.queue.id.and.statistics.map.QueueIdAndStatisticsMapBuilder)5 Counter32 (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter32)4 DurationBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.duration.DurationBuilder)4 BigInteger (java.math.BigInteger)3 GetQueueStatisticsOutput (org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetQueueStatisticsOutput)3 QueueStats (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.queue._case.multipart.reply.queue.QueueStats)3 MultipartReplyQueueStatsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.multipart.reply.multipart.reply.body.MultipartReplyQueueStatsBuilder)3