Bug 3258 : Changed the order of condition for OrderedMap and MapNode, 67/20667/3
authorHarman Singh <harmasin@cisco.com>
Mon, 18 May 2015 18:10:23 +0000 (11:10 -0700)
committerGerrit Code Review <gerrit@opendaylight.org>
Tue, 19 May 2015 12:18:17 +0000 (12:18 +0000)
same for OrderedLeafSet and LeafSet
Added a test to validate it works for OrderedMap

Change-Id: Ifb0375d47668fcc36d824fb33a8b4684e89dccc8
Signed-off-by: Harman Singh <harmasin@cisco.com>
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/serialization/NormalizedNodeType.java
opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/util/TestModel.java

index b7460e8..01e56e8 100644 (file)
@@ -50,18 +50,18 @@ public enum NormalizedNodeType {
             return MAP_ENTRY_NODE_TYPE;
         } else if(node instanceof ContainerNode){
             return CONTAINER_NODE_TYPE;
-        } else if(node instanceof MapNode){
-            return MAP_NODE_TYPE;
         } else if(node instanceof AugmentationNode){
             return AUGMENTATION_NODE_TYPE;
-        } else if(node instanceof LeafSetNode){
-            return LEAF_SET_NODE_TYPE;
         } else if(node instanceof ChoiceNode){
             return CHOICE_NODE_TYPE;
         } else if(node instanceof OrderedLeafSetNode){
             return ORDERED_LEAF_SET_NODE_TYPE;
         } else if(node instanceof OrderedMapNode){
             return ORDERED_MAP_NODE_TYPE;
+        } else if(node instanceof MapNode){
+            return MAP_NODE_TYPE;
+        } else if(node instanceof LeafSetNode){
+            return LEAF_SET_NODE_TYPE;
         } else if(node instanceof UnkeyedListNode){
             return UNKEYED_LIST_NODE_TYPE;
         } else if(node instanceof UnkeyedListEntryNode){
index aa1cfc6..d27d650 100644 (file)
@@ -13,6 +13,8 @@ package org.opendaylight.controller.cluster.datastore.util;
 import static org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes.mapEntry;
 import static org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes.mapEntryBuilder;
 import static org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes.mapNodeBuilder;
+
+import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableSet;
 import java.io.InputStream;
 import java.math.BigDecimal;
@@ -342,6 +344,9 @@ public class TestModel {
               .withChild(Builders.choiceBuilder()
                    .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(CHOICE_QNAME))
                    .withChild(ImmutableNodes.leafNode(DESC_QNAME, LONG_ID)).build())
+                   .withChild(Builders.orderedMapBuilder().
+                       withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(DESC_QNAME)).
+                       withValue(ImmutableList.<MapEntryNode>builder().add(augMapEntry).build()).build())
                       // .withChild(augmentationNode)
               .withChild(shoes)
               .withChild(numbers)

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.