Search in sources :

Example 1 with GetQueueStatisticsInput

use of org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetQueueStatisticsInput in project openflowplugin by opendaylight.

the class OpendaylightDirectStatisticsServiceImplTest method testGetQueueStatisticsFail.

@Test
public void testGetQueueStatisticsFail() throws Exception {
    RpcResult<GetQueueStatisticsOutput> result = emptyService.getQueueStatistics(getQueueStatisticsInput).get();
    assertFalse(result.isSuccessful());
    for (RpcError error : result.getErrors()) {
        assertTrue(error.getMessage().contains(AbstractQueueDirectStatisticsService.class.getSimpleName()));
    }
    verify(queueDirectStatisticsService, times(0)).handleAndReply(getQueueStatisticsInput);
}
Also used : GetQueueStatisticsOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetQueueStatisticsOutput) RpcError(org.opendaylight.yangtools.yang.common.RpcError) Test(org.junit.Test)

Example 2 with GetQueueStatisticsInput

use of org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetQueueStatisticsInput 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(new NodeConnectorId(NODE_ID + ":" + PORT_NO));
    final MultipartRequestQueueCase body = (MultipartRequestQueueCase) ((MultipartRequestInput) service.buildRequest(new Xid(42L), input)).getMultipartRequestBody();
    final MultipartRequestQueue queue = body.getMultipartRequestQueue();
    assertEquals(PORT_NO, queue.getPortNo());
    assertEquals(QUEUE_NO, queue.getQueueId());
}
Also used : Xid(org.opendaylight.openflowplugin.api.openflow.device.Xid) MultipartRequestQueue(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.queue._case.MultipartRequestQueue) NodeConnectorId(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId) QueueId(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.queue.rev130925.QueueId) MultipartRequestQueueCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestQueueCase) GetQueueStatisticsInput(org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetQueueStatisticsInput)

Example 3 with GetQueueStatisticsInput

use of org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetQueueStatisticsInput 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

Xid (org.opendaylight.openflowplugin.api.openflow.device.Xid)2 GetQueueStatisticsInput (org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetQueueStatisticsInput)2 QueueId (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.queue.rev130925.QueueId)2 Test (org.junit.Test)1 GetQueueStatisticsOutput (org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetQueueStatisticsOutput)1 NodeConnectorId (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId)1 MultipartRequestQueueCase (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestQueueCase)1 MultipartRequestQueue (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.queue._case.MultipartRequestQueue)1 MultipartRequestQueueStats (org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.multipart.request.multipart.request.body.MultipartRequestQueueStats)1 RpcError (org.opendaylight.yangtools.yang.common.RpcError)1