use of org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetGroupStatisticsInput 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 MultipartRequestGroupStats body = (MultipartRequestGroupStats) ((MultipartRequest) service.buildRequest(new Xid(42L), input)).getMultipartRequestBody();
assertEquals(GROUP_NO, body.getGroupId().getValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetGroupStatisticsInput 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.direct.statistics.rev160511.GetGroupStatisticsInput in project openflowplugin by opendaylight.
the class OpendaylightDirectStatisticsServiceImplTest method testGetGroupStatisticsFail.
@Test
public void testGetGroupStatisticsFail() throws Exception {
RpcResult<GetGroupStatisticsOutput> result = emptyService.getGroupStatistics(getGroupStatisticsInput).get();
assertFalse(result.isSuccessful());
for (RpcError error : result.getErrors()) {
assertTrue(error.getMessage().contains(AbstractGroupDirectStatisticsService.class.getSimpleName()));
}
verify(groupDirectStatisticsService, times(0)).handleAndReply(getGroupStatisticsInput);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetGroupStatisticsInput in project openflowplugin by opendaylight.
the class GroupStatsService method buildRequest.
@Override
protected OfHeader buildRequest(final Xid xid, final GetGroupStatisticsInput input) throws ServiceException {
final MultipartRequestGroupCaseBuilder caseBuilder = new MultipartRequestGroupCaseBuilder();
final MultipartRequestGroupBuilder mprGroupBuild = new MultipartRequestGroupBuilder();
mprGroupBuild.setGroupId(new GroupId(input.getGroupId().getValue()));
caseBuilder.setMultipartRequestGroup(mprGroupBuild.build());
final MultipartRequestInputBuilder mprInput = RequestInputUtils.createMultipartHeader(MultipartType.OFPMPGROUP, xid.getValue(), getVersion());
mprInput.setMultipartRequestBody(caseBuilder.build());
return mprInput.build();
}
Aggregations