use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.meter._case.MultipartRequestMeter in project openflowplugin by opendaylight.
the class MultipartRequestInputFactoryTest method testMakeMultipartRequestInputMeter.
@Test
public void testMakeMultipartRequestInputMeter() throws Exception {
final MultipartType mpType = MultipartType.OFPMPMETER;
final MultipartRequestInput mpRqInput = (MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
checkHeader(mpRqInput, mpType);
final MultipartRequestBody mpRqBody = mpRqInput.getMultipartRequestBody();
Assert.assertTrue(mpRqBody instanceof MultipartRequestMeterCase);
MultipartRequestMeter mpRq = ((MultipartRequestMeterCase) mpRqBody).getMultipartRequestMeter();
Assert.assertEquals(OFConstants.OFPM_ALL, mpRq.getMeterId().getValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.meter._case.MultipartRequestMeter in project openflowplugin by opendaylight.
the class MultipartRequestInputFactory method serializeMeterBody.
private static void serializeMeterBody(final MultipartRequestBody multipartRequestBody, final ByteBuf output) {
MultipartRequestMeterCase meterCase = (MultipartRequestMeterCase) multipartRequestBody;
MultipartRequestMeter meter = meterCase.getMultipartRequestMeter();
output.writeInt(meter.getMeterId().getValue().intValue());
output.writeZero(PADDING_IN_MULTIPART_REQUEST_METER_BODY);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.meter._case.MultipartRequestMeter in project openflowplugin by opendaylight.
the class MeterDirectStatisticsServiceTest method testBuildRequestBody.
@Override
public void testBuildRequestBody() throws Exception {
final GetMeterStatisticsInput input = mock(GetMeterStatisticsInput.class);
when(input.getNode()).thenReturn(createNodeRef(NODE_ID));
when(input.getMeterId()).thenReturn(new MeterId(METER_NO));
final MultipartRequestMeterCase body = (MultipartRequestMeterCase) ((MultipartRequestInput) service.buildRequest(new Xid(42L), input)).getMultipartRequestBody();
final MultipartRequestMeter meter = body.getMultipartRequestMeter();
assertEquals(METER_NO, meter.getMeterId().getValue());
}
Aggregations