Search in sources :

Example 1 with GetMeterFeaturesOutput

use of org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetMeterFeaturesOutput in project openflowplugin by opendaylight.

the class OpendaylightMeterStatisticsServiceImplTest method testGetMeterFeatures.

@Test
public void testGetMeterFeatures() throws Exception {
    GetMeterFeaturesInputBuilder input = new GetMeterFeaturesInputBuilder().setNode(createNodeRef("unitProt:123"));
    rpcResult = RpcResultBuilder.<Object>success(Collections.singletonList(new MultipartReplyMessageBuilder().setVersion(OFConstants.OFP_VERSION_1_3).setMultipartReplyBody(new MultipartReplyMeterFeaturesCaseBuilder().setMultipartReplyMeterFeatures(new MultipartReplyMeterFeaturesBuilder().setBandTypes(new MeterBandTypeBitmap(true, false)).setCapabilities(new MeterFlags(true, false, false, false)).setMaxBands((short) 71).setMaxColor((short) 72).setMaxMeter(73L).build()).build()).build())).build();
    final Future<RpcResult<GetMeterFeaturesOutput>> resultFuture = meterStatisticsService.getMeterFeatures(input.build());
    Assert.assertTrue(resultFuture.isDone());
    final RpcResult<GetMeterFeaturesOutput> rpcResult = resultFuture.get();
    Assert.assertTrue(rpcResult.isSuccessful());
    Assert.assertEquals(MultipartType.OFPMPMETERFEATURES, requestInput.getValue().getType());
}
Also used : MultipartReplyMeterFeaturesCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.MultipartReplyMeterFeaturesCaseBuilder) MultipartReplyMessageBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReplyMessageBuilder) MultipartReplyMeterFeaturesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.meter.features._case.MultipartReplyMeterFeaturesBuilder) GetMeterFeaturesOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetMeterFeaturesOutput) MeterFlags(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MeterFlags) RpcResult(org.opendaylight.yangtools.yang.common.RpcResult) MeterBandTypeBitmap(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MeterBandTypeBitmap) GetMeterFeaturesInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetMeterFeaturesInputBuilder) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 GetMeterFeaturesInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetMeterFeaturesInputBuilder)1 GetMeterFeaturesOutput (org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetMeterFeaturesOutput)1 MeterBandTypeBitmap (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MeterBandTypeBitmap)1 MeterFlags (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MeterFlags)1 MultipartReplyMessageBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReplyMessageBuilder)1 MultipartReplyMeterFeaturesCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.MultipartReplyMeterFeaturesCaseBuilder)1 MultipartReplyMeterFeaturesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.meter.features._case.MultipartReplyMeterFeaturesBuilder)1 RpcResult (org.opendaylight.yangtools.yang.common.RpcResult)1