Search in sources :

Example 1 with GroupDescStatsReply

use of org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupDescStatsReply in project openflowplugin by opendaylight.

the class MultipartReplyTranslatorTest method testTranslateGroupDesc.

@Test
public void testTranslateGroupDesc() {
    DeviceContext mockedDeviceContext = mock(DeviceContext.class);
    MultipartReplyMessage multipartReplyMessage = prepareMocks(mockedDeviceContext, prepareMultipartReplyGroupDesc(), MultipartType.OFPMPGROUPDESC);
    DataContainer result = MultipartReplyTranslatorUtil.translate(multipartReplyMessage, mockedDeviceContext.getDeviceInfo(), CONVERTOR_MANAGER, mockedDeviceContext.oook()).get();
    DataContainer dataObject = validateOutput(result);
    assertTrue(dataObject instanceof GroupDescStatsReply);
    GroupDescStatsReply groupStatistics = (GroupDescStatsReply) dataObject;
    List<GroupDescStats> groupDescStats = groupStatistics.getGroupDescStats();
    assertEquals(1, groupDescStats.size());
    GroupDescStats groupDescStat = groupDescStats.get(0);
    assertEquals(DUMMY_GROUP_ID.getValue(), groupDescStat.getGroupId().getValue());
    assertEquals(DUMMY_GROUPS_TYPE, groupDescStat.getGroupType());
}
Also used : DeviceContext(org.opendaylight.openflowplugin.api.openflow.device.DeviceContext) MultipartReplyMessage(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReplyMessage) DataContainer(org.opendaylight.yangtools.yang.binding.DataContainer) GroupDescStatsReply(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupDescStatsReply) GroupDescStats(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.desc.stats.reply.GroupDescStats) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 DeviceContext (org.opendaylight.openflowplugin.api.openflow.device.DeviceContext)1 GroupDescStatsReply (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupDescStatsReply)1 GroupDescStats (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.desc.stats.reply.GroupDescStats)1 MultipartReplyMessage (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReplyMessage)1 DataContainer (org.opendaylight.yangtools.yang.binding.DataContainer)1