use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.group._case.MultipartRequestGroup in project openflowplugin by opendaylight.
the class GroupDirectStatisticsServiceTest method testBuildRequestBody.
@Override
public void testBuildRequestBody() throws Exception {
final GetGroupStatisticsInput input = mock(GetGroupStatisticsInput.class);
when(input.getNode()).thenReturn(createNodeRef(NODE_ID));
when(input.getGroupId()).thenReturn(new GroupId(GROUP_NO));
final MultipartRequestGroupCase body = (MultipartRequestGroupCase) ((MultipartRequestInput) service.buildRequest(new Xid(42L), input)).getMultipartRequestBody();
final MultipartRequestGroup group = body.getMultipartRequestGroup();
assertEquals(GROUP_NO, group.getGroupId().getValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.group._case.MultipartRequestGroup in project openflowplugin by opendaylight.
the class MultipartRequestInputFactoryTest method testMakeMultipartRequestInputGroup.
@Test
public void testMakeMultipartRequestInputGroup() throws Exception {
final MultipartType mpType = MultipartType.OFPMPGROUP;
final MultipartRequestInput mpRqInput = (MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
checkHeader(mpRqInput, mpType);
final MultipartRequestBody mpRqBody = mpRqInput.getMultipartRequestBody();
Assert.assertTrue(mpRqBody instanceof MultipartRequestGroupCase);
MultipartRequestGroup mpRq = ((MultipartRequestGroupCase) mpRqBody).getMultipartRequestGroup();
Assert.assertEquals(OFConstants.OFPG_ALL, mpRq.getGroupId().getValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.group._case.MultipartRequestGroup in project openflowplugin by opendaylight.
the class MultipartRequestInputFactory method serializeeGroupStatsBody.
private static void serializeeGroupStatsBody(final MultipartRequestBody multipartRequestBody, final ByteBuf output) {
MultipartRequestGroupCase groupStatsCase = (MultipartRequestGroupCase) multipartRequestBody;
MultipartRequestGroup groupStats = groupStatsCase.getMultipartRequestGroup();
output.writeInt(groupStats.getGroupId().getValue().intValue());
output.writeZero(PADDING_IN_MULTIPART_REQUEST_GROUP_BODY);
}
Aggregations