MRI version bumpup for Aluminium
[netvirt.git] / elanmanager / impl / src / test / java / org / opendaylight / netvirt / elanmanager / tests / Verifications.java
index 10c032e270a2b34645dfc84d20ce9eb1c5cbdbc2..2a31e13724627b5f3858afaedba7a9c799d097e8 100644 (file)
@@ -7,7 +7,7 @@
  */
 package org.opendaylight.netvirt.elanmanager.tests;
 
-import static org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType.CONFIGURATION;
+import static org.opendaylight.mdsal.common.api.LogicalDatastoreType.CONFIGURATION;
 
 import com.google.common.collect.Sets;
 import java.util.ArrayList;
@@ -20,15 +20,16 @@ import java.util.function.BiPredicate;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 import org.awaitility.core.ConditionFactory;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
 import org.opendaylight.genius.datastoreutils.SingleTransactionDataBroker;
 import org.opendaylight.genius.mdsalutil.MDSALUtil;
 import org.opendaylight.genius.mdsalutil.NwConstants;
 import org.opendaylight.genius.mdsalutil.actions.ActionGroup;
 import org.opendaylight.genius.testutils.interfacemanager.TunnelInterfaceDetails;
 import org.opendaylight.mdsal.binding.testutils.AssertDataObjects;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.ReadFailedException;
+import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
+import org.opendaylight.netvirt.elan.utils.ElanConstants;
 import org.opendaylight.netvirt.elan.utils.ElanUtils;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
@@ -126,7 +127,7 @@ public class Verifications {
                 }
             }
             boolean remoteMcastFoundFlag = false;
-            for (RemoteMcastMacs remoteMcastMacs : augmentation.getRemoteMcastMacs()) {
+            for (RemoteMcastMacs remoteMcastMacs : augmentation.getRemoteMcastMacs().values()) {
                 for (LocatorSet locatorSet : remoteMcastMacs.getLocatorSet()) {
                     TpId tpId = locatorSet.getLocatorRef().getValue().firstKeyOf(TerminationPoint.class).getTpId();
                     if (tpId.getValue().contains(tepIp)) {
@@ -170,7 +171,7 @@ public class Verifications {
                 }
             }
             boolean remoteUcastFoundFlag = false;
-            for (RemoteUcastMacs remoteUcastMacs : augmentation.getRemoteUcastMacs()) {
+            for (RemoteUcastMacs remoteUcastMacs : augmentation.getRemoteUcastMacs().values()) {
                 String mac = remoteUcastMacs.getMacEntryKey().getValue();
                 if (mac.equals(dpnMac)) {
                     remoteUcastFoundFlag = true;
@@ -198,10 +199,10 @@ public class Verifications {
             for (Uint64 otherDpn : otherDpns) {
                 GetEgressActionsForInterfaceInput getEgressActInput = new GetEgressActionsForInterfaceInputBuilder()
                         .setIntfName(extnIntfs.get(dpnId + ":" + otherDpn).getInterfaceInfo().getInterfaceName())
-                        .setTunnelKey(elanInfo.getElanTag()).build();
+                        .setTunnelKey(elanInfo.getElanTag().longValue() + ElanConstants.ELAN_TAG_ADDEND).build();
                 List<Action> actionsList =
-                        odlInterfaceRpcService.getEgressActionsForInterface(getEgressActInput).get().getResult()
-                                .getAction();
+                        new ArrayList<Action>(odlInterfaceRpcService.getEgressActionsForInterface(getEgressActInput)
+                                .get().getResult().getAction().values());
                 listBucketInfo.add(MDSALUtil.buildBucket(actionsList, MDSALUtil.GROUP_WEIGHT, bucketId,
                         MDSALUtil.WATCH_PORT, MDSALUtil.WATCH_GROUP));
 
@@ -215,8 +216,8 @@ public class Verifications {
                         .setIntfName(extnIntfs.get(dpnId + ":" + otherTor).getInterfaceInfo().getInterfaceName())
                         .setTunnelKey(elanInfo.getSegmentationId()).build();
                 List<Action> actionsList =
-                        odlInterfaceRpcService.getEgressActionsForInterface(getEgressActInput).get().getResult()
-                                .getAction();
+                        new ArrayList<Action>(odlInterfaceRpcService.getEgressActionsForInterface(getEgressActInput)
+                                .get().getResult().getAction().values());
                 listBucketInfo.add(MDSALUtil.buildBucket(actionsList, MDSALUtil.GROUP_WEIGHT, bucketId,
                         MDSALUtil.WATCH_PORT, MDSALUtil.WATCH_GROUP));
 
@@ -260,8 +261,8 @@ public class Verifications {
             AssertDataObjects.assertEqualBeans(expected, actual);
         }
 
-        Set<Bucket> actualBuckets = modifyBucketId(actual.getBuckets().getBucket());
-        Set<Bucket> expectedBuckets = modifyBucketId(expected.getBuckets().getBucket());
+        Set<Bucket> actualBuckets = modifyBucketId(new ArrayList<Bucket>(actual.getBuckets().getBucket().values()));
+        Set<Bucket> expectedBuckets = modifyBucketId(new ArrayList<Bucket>(expected.getBuckets().getBucket().values()));
         Set<Bucket> diff = Sets.difference(actualBuckets, expectedBuckets);
         if (diff != null && !diff.isEmpty()) {
             AssertDataObjects.assertEqualBeans(expected, actual);
@@ -389,11 +390,7 @@ public class Verifications {
                 .child(ElanInstance.class, new ElanInstanceKey(ExpectedObjects.ELAN1)).build();
         ElanInstance actualElanInstances = singleTxdataBroker.syncRead(CONFIGURATION, elanInstanceIid);
         FlowId flowId = new FlowId(
-                ElanUtils.getKnownDynamicmacFlowRef(NwConstants.ELAN_DMAC_TABLE,
-                        srcDpnId,
-                        dpnId,
-                        dpnMac,
-                        actualElanInstances.getElanTag()));
+                ElanUtils.getKnownDynamicmacFlowRef(actualElanInstances.getElanTag(), dpnMac));
         InstanceIdentifier<Flow> flowInstanceIidDst = getFlowIid(NwConstants.ELAN_DMAC_TABLE, flowId, srcDpnId);
         if (createFlag) {
             awaitForData(LogicalDatastoreType.CONFIGURATION, flowInstanceIidDst);