Search in sources :

Example 6 with GroupDescBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.group.desc._case.multipart.reply.group.desc.GroupDescBuilder 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();
}
Also used : MultipartReplyGroupDescBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.group.desc._case.MultipartReplyGroupDescBuilder) GroupDescBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.group.desc._case.multipart.reply.group.desc.GroupDescBuilder) MultipartReplyGroupDescBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.group.desc._case.MultipartReplyGroupDescBuilder) MultipartReplyGroupDescCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.MultipartReplyGroupDescCaseBuilder)

Example 7 with GroupDescBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.group.desc._case.multipart.reply.group.desc.GroupDescBuilder 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));
}
Also used : Group(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group) BucketsListBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.buckets.grouping.BucketsListBuilder) MultipartType(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType) MultipartReply(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReply) FlowCapableNode(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode) GroupKey(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.GroupKey) MultipartReplyGroupDescCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.MultipartReplyGroupDescCaseBuilder) GroupId(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.GroupId) PortNumber(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber) MultipartReplyGroupDescBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.group.desc._case.MultipartReplyGroupDescBuilder) GroupDescBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.group.desc._case.multipart.reply.group.desc.GroupDescBuilder) MultipartReplyGroupDescBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.group.desc._case.MultipartReplyGroupDescBuilder) Test(org.junit.Test)

Aggregations

GroupDescBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.group.desc._case.multipart.reply.group.desc.GroupDescBuilder)7 GroupId (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.GroupId)5 MultipartReplyGroupDescBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.group.desc._case.MultipartReplyGroupDescBuilder)5 ArrayList (java.util.ArrayList)4 Test (org.junit.Test)4 PortNumber (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber)4 BucketsListBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.buckets.grouping.BucketsListBuilder)4 MultipartReplyGroupDescCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.MultipartReplyGroupDescCaseBuilder)4 GroupDesc (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.group.desc._case.multipart.reply.group.desc.GroupDesc)4 VersionConvertorData (org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.data.VersionConvertorData)2 GroupDescStats (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.desc.stats.reply.GroupDescStats)2 Action (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action)2 BucketsList (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.buckets.grouping.BucketsList)2 CodeKeyMaker (org.opendaylight.openflowjava.protocol.impl.util.CodeKeyMaker)1 FlowCapableNode (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode)1 GetGroupDescriptionInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetGroupDescriptionInputBuilder)1 GetGroupDescriptionOutput (org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetGroupDescriptionOutput)1 Bucket (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.buckets.Bucket)1 Group (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group)1 GroupKey (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.GroupKey)1