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