use of org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupStatisticsReply in project openflowplugin by opendaylight.
the class MultipartReplyTranslatorTest method testTranslateGroup.
@Test
public void testTranslateGroup() {
DeviceContext mockedDeviceContext = mock(DeviceContext.class);
MultipartReplyMessage multipartReplyMessage = prepareMocks(mockedDeviceContext, prepareMultipartReplyGroup(), MultipartType.OFPMPGROUP);
DataContainer result = MultipartReplyTranslatorUtil.translate(multipartReplyMessage, mockedDeviceContext.getDeviceInfo(), CONVERTOR_MANAGER, mockedDeviceContext.oook()).get();
DataContainer dataObject = validateOutput(result);
assertTrue(dataObject instanceof GroupStatisticsReply);
GroupStatisticsReply groupStatisticsUpdate = (GroupStatisticsReply) dataObject;
List<org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.statistics.reply.GroupStats> groupStats = groupStatisticsUpdate.getGroupStats();
assertEquals(1, groupStats.size());
org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.statistics.reply.GroupStats groupStat = groupStats.get(0);
assertEquals(DUMMY_BYTE_COUNT, groupStat.getByteCount().getValue());
assertEquals(DUMMY_DURATION_SEC, groupStat.getDuration().getSecond().getValue());
assertEquals(DUMMY_DURATION_NSEC, groupStat.getDuration().getNanosecond().getValue());
assertEquals(DUMMY_GROUP_ID.getValue(), groupStat.getGroupId().getValue());
assertEquals(DUMMY_PACKET_COUNT, groupStat.getPacketCount().getValue());
assertEquals(DUMMY_REF_COUNT, groupStat.getRefCount().getValue());
}
Aggregations