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);
}
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());
}
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());
}
Aggregations