use of org.opendaylight.netvirt.elan.l2gw.ha.commands.RemoteUcastCmd in project netvirt by opendaylight.
the class TestComparators method compareRemoteUcastMacs.
public static void compareRemoteUcastMacs(Node d1, Node d2, Node ha, InstanceIdentifier<Node> nodePath) {
RemoteUcastCmd cmd = new RemoteUcastCmd();
HwvtepGlobalAugmentation d1Aug = d1.getAugmentation(HwvtepGlobalAugmentation.class);
HwvtepGlobalAugmentation d2Aug = d2.getAugmentation(HwvtepGlobalAugmentation.class);
HwvtepGlobalAugmentation haAug = ha.getAugmentation(HwvtepGlobalAugmentation.class);
List<RemoteUcastMacs> d1Values = d1Aug.getRemoteUcastMacs() != null ? d1Aug.getRemoteUcastMacs() : new ArrayList<>();
List<RemoteUcastMacs> result1 = cmd.transform(nodePath, d1Values);
List<RemoteUcastMacs> d2Values = d2Aug.getRemoteUcastMacs() != null ? d2Aug.getRemoteUcastMacs() : new ArrayList<>();
List<RemoteUcastMacs> result2 = cmd.transform(nodePath, d2Values);
List<RemoteUcastMacs> ruMacList = new ArrayList<>();
ruMacList.addAll(result1);
ruMacList.addAll(result2);
List<RemoteUcastMacs> result = cmd.transform(nodePath, haAug.getRemoteUcastMacs());
Set<RemoteUcastMacs> set1 = Sets.newHashSet(ruMacList);
Set<RemoteUcastMacs> set2 = Sets.newHashSet(result);
assertEquals("should have equal remote ucast macs ", 0, Sets.difference(set1, set2).size());
}
Aggregations