Search in sources :

Example 1 with GroupAdded

use of org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.GroupAdded in project openflowplugin by opendaylight.

the class GroupNotificationSupplierImplTest method testCreate.

@Test
public void testCreate() {
    final GroupAdded notification = notifSupplierImpl.createNotification(createTestGroup(), createTestGroupPath());
    assertNotNull(notification);
    assertEquals(GROUP_ID, notification.getGroupId().getValue());
    assertEquals(GROUP_ID, notification.getGroupRef().getValue().firstKeyOf(Group.class, GroupKey.class).getGroupId().getValue());
    assertEquals(FLOW_NODE_ID, notification.getNode().getValue().firstKeyOf(Node.class, NodeKey.class).getId().getValue());
}
Also used : Group(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group) GroupAdded(org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.GroupAdded) FlowCapableNode(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode) Node(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node) GroupKey(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.GroupKey) NodeKey(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey) Test(org.junit.Test)

Example 2 with GroupAdded

use of org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.GroupAdded in project openflowplugin by opendaylight.

the class GroupNotificationSupplierImpl method createNotification.

@Override
public GroupAdded createNotification(final Group dataTreeItemObject, final InstanceIdentifier<Group> path) {
    Preconditions.checkArgument(dataTreeItemObject != null);
    Preconditions.checkArgument(path != null);
    final GroupAddedBuilder builder = new GroupAddedBuilder(dataTreeItemObject);
    builder.setGroupRef(new GroupRef(path));
    builder.setNode(createNodeRef(path));
    return builder.build();
}
Also used : GroupRef(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupRef) GroupAddedBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.GroupAddedBuilder)

Aggregations

Test (org.junit.Test)1 FlowCapableNode (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode)1 GroupAdded (org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.GroupAdded)1 GroupAddedBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.GroupAddedBuilder)1 GroupRef (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupRef)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 Node (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node)1 NodeKey (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey)1