use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId 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.inventory.rev130819.NodeConnectorId in project openflowplugin by opendaylight.
the class MatchNormalizationUtilTest method normalizeInPhyPortMatch.
@Test
public void normalizeInPhyPortMatch() {
final long port = 10;
final MatchBuilder matchBuilder = MatchNormalizationUtil.normalizeInPhyPortMatch(new MatchBuilder().setInPhyPort(new NodeConnectorId("openflow:1:" + port)), EncodeConstants.OF13_VERSION_ID);
assertEquals(String.valueOf(port), matchBuilder.getInPhyPort().getValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId in project openflowplugin by opendaylight.
the class MatchNormalizationUtilTest method normalizeInPortMatch.
@Test
public void normalizeInPortMatch() {
final long port = 10;
final MatchBuilder matchBuilder = MatchNormalizationUtil.normalizeInPortMatch(new MatchBuilder().setInPort(new NodeConnectorId("openflow:1:" + port)), EncodeConstants.OF13_VERSION_ID);
assertEquals(String.valueOf(port), matchBuilder.getInPort().getValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId in project openflowplugin by opendaylight.
the class OpendaylightQueueStatisticsServiceImplTest method testGetAllQueuesStatisticsFromGivenPort.
@Test
public void testGetAllQueuesStatisticsFromGivenPort() throws Exception {
Mockito.doAnswer(answerVoidToCallback).when(outboundQueueProvider).commitEntry(Matchers.eq(42L), requestInput.capture(), Matchers.any(FutureCallback.class));
GetAllQueuesStatisticsFromGivenPortInputBuilder input = new GetAllQueuesStatisticsFromGivenPortInputBuilder().setNode(createNodeRef("unitProt:123")).setNodeConnectorId(new NodeConnectorId("unitProt:123:321"));
rpcResult = buildQueueStatsReply();
final Future<RpcResult<GetAllQueuesStatisticsFromGivenPortOutput>> resultFuture = queueStatisticsService.getAllQueuesStatisticsFromGivenPort(input.build());
Assert.assertTrue(resultFuture.isDone());
final RpcResult<GetAllQueuesStatisticsFromGivenPortOutput> rpcResult = resultFuture.get();
Assert.assertTrue(rpcResult.isSuccessful());
Assert.assertEquals(MultipartType.OFPMPQUEUE, requestInput.getValue().getType());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId in project openflowplugin by opendaylight.
the class OpendaylightQueueStatisticsServiceImplTest method testGetQueueStatisticsFromGivenPort.
@Test
public void testGetQueueStatisticsFromGivenPort() throws Exception {
Mockito.doAnswer(answerVoidToCallback).when(outboundQueueProvider).commitEntry(Matchers.eq(42L), requestInput.capture(), Matchers.any(FutureCallback.class));
GetQueueStatisticsFromGivenPortInputBuilder input = new GetQueueStatisticsFromGivenPortInputBuilder().setNode(createNodeRef("unitProt:123")).setNodeConnectorId(new NodeConnectorId("unitProt:123:321")).setQueueId(new QueueId(21L));
rpcResult = buildQueueStatsReply();
final Future<RpcResult<GetQueueStatisticsFromGivenPortOutput>> resultFuture = queueStatisticsService.getQueueStatisticsFromGivenPort(input.build());
Assert.assertTrue(resultFuture.isDone());
final RpcResult<GetQueueStatisticsFromGivenPortOutput> rpcResult = resultFuture.get();
Assert.assertTrue(rpcResult.isSuccessful());
Assert.assertEquals(MultipartType.OFPMPQUEUE, requestInput.getValue().getType());
}
Aggregations