use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.group.desc._case.MultipartReplyGroupDescBuilder in project openflowplugin by opendaylight.
the class MultipartReplyTranslatorTest method prepareMultipartReplyGroupDesc.
private MultipartReplyBody prepareMultipartReplyGroupDesc() {
GroupDescBuilder groupDescBuilder = new GroupDescBuilder();
groupDescBuilder.setGroupId(DUMMY_GROUP_ID);
groupDescBuilder.setBucketsList(Collections.<BucketsList>emptyList());
groupDescBuilder.setType(DUMMY_GROUP_TYPE);
MultipartReplyGroupDescBuilder multipartReplyGroupDescBuilder = new MultipartReplyGroupDescBuilder();
multipartReplyGroupDescBuilder.setGroupDesc(Lists.newArrayList(groupDescBuilder.build()));
MultipartReplyGroupDescCaseBuilder multipartReplyGroupDescCaseBuilder = new MultipartReplyGroupDescCaseBuilder();
multipartReplyGroupDescCaseBuilder.setMultipartReplyGroupDesc(multipartReplyGroupDescBuilder.build());
return multipartReplyGroupDescCaseBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.group.desc._case.MultipartReplyGroupDescBuilder in project openflowplugin by opendaylight.
the class StatisticsGatheringUtilsTest method testGatherStatistics_groupDesc.
@Test
public void testGatherStatistics_groupDesc() throws Exception {
final MultipartType type = MultipartType.OFPMPGROUPDESC;
final long groupIdValue = 27L;
final BucketsListBuilder bucketsListBld = new BucketsListBuilder().setWatchPort(new PortNumber(5L));
final GroupDescBuilder groupStatsBld = new GroupDescBuilder().setBucketsList(Lists.newArrayList(bucketsListBld.build())).setGroupId(new GroupId(groupIdValue)).setType(GroupType.OFPGTALL);
final MultipartReplyGroupDescBuilder mpReplyGroupBld = new MultipartReplyGroupDescBuilder();
mpReplyGroupBld.setGroupDesc(Lists.newArrayList(groupStatsBld.build()));
final MultipartReplyGroupDescCaseBuilder mpReplyGroupCaseBld = new MultipartReplyGroupDescCaseBuilder();
mpReplyGroupCaseBld.setMultipartReplyGroupDesc(mpReplyGroupBld.build());
final MultipartReply groupStatsUpdated = assembleMPReplyMessage(type, mpReplyGroupCaseBld.build());
final List<MultipartReply> statsData = Collections.singletonList(groupStatsUpdated);
fireAndCheck(type, statsData);
final org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupId storedGroupId = new org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupId(groupIdValue);
final KeyedInstanceIdentifier<Group, GroupKey> groupPath = dummyNodePath.augmentation(FlowCapableNode.class).child(Group.class, new GroupKey(storedGroupId));
verify(deviceContext, Mockito.never()).addDeleteToTxChain(Matchers.eq(LogicalDatastoreType.OPERATIONAL), Matchers.<InstanceIdentifier<?>>any());
verify(deviceGroupRegistry).store(storedGroupId);
verify(deviceContext).writeToTransaction(Matchers.eq(LogicalDatastoreType.OPERATIONAL), Matchers.eq(groupPath), Matchers.any(Group.class));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.group.desc._case.MultipartReplyGroupDescBuilder in project openflowplugin by opendaylight.
the class MultipartReplyTranslatorUtilTest method translateGroupDesc.
@Test
public void translateGroupDesc() {
final MultipartReply multipartReply = buildReply(MultipartType.OFPMPGROUPDESC, new MultipartReplyGroupDescCaseBuilder().setMultipartReplyGroupDesc(new MultipartReplyGroupDescBuilder().build()).build());
dummyAssertReply(multipartReply);
}
Aggregations