Serializer helper namespace as module name support changes

Change-Id: I483d397b3d74754b64bf9ad74309d7b43df240bf
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangContainer.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangContainer.java
index abf6652..2278bef 100644
--- a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangContainer.java
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangContainer.java
@@ -30,6 +30,7 @@
 import java.util.List;
 
 import static com.google.common.base.Preconditions.checkNotNull;
+import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.E_ID;
 import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.FMT_NOT_EXIST;
 import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.detectCollidingChildUtil;
 import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.errorMsg;
@@ -574,7 +575,7 @@
     @Override
     public SchemaContext getChildContext(SchemaId schemaId) {
 
-        checkNotNull(schemaId);
+        checkNotNull(schemaId, E_ID);
         YangSchemaNodeIdentifier id = getNodeIdFromSchemaId(
                 schemaId, getNameSpace().getModuleNamespace());
         try {
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangInput.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangInput.java
index bc69391..8762d1c 100644
--- a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangInput.java
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangInput.java
@@ -36,6 +36,7 @@
 import static org.onosproject.yang.compiler.datamodel.exceptions.ErrorMessages.COLLISION_DETECTION;
 import static org.onosproject.yang.compiler.datamodel.exceptions.ErrorMessages.INPUT;
 import static org.onosproject.yang.compiler.datamodel.exceptions.ErrorMessages.getErrorMsgCollision;
+import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.E_ID;
 import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.FMT_NOT_EXIST;
 import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.detectCollidingChildUtil;
 import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.errorMsg;
@@ -274,7 +275,7 @@
     @Override
     public SchemaContext getChildContext(SchemaId schemaId) {
 
-        checkNotNull(schemaId);
+        checkNotNull(schemaId, E_ID);
         YangSchemaNodeIdentifier id = getNodeIdFromSchemaId(
                 schemaId, getNameSpace().getModuleNamespace());
         try {
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangList.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangList.java
index deaa24c..37abeb2 100644
--- a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangList.java
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangList.java
@@ -35,6 +35,7 @@
 import static org.onosproject.yang.compiler.datamodel.YangNodeType.LIST_NODE;
 import static org.onosproject.yang.compiler.datamodel.YangSchemaNodeType.YANG_MULTI_INSTANCE_NODE;
 import static org.onosproject.yang.compiler.datamodel.YangStatusType.CURRENT;
+import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.E_ID;
 import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.FMT_NOT_EXIST;
 import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.errorMsg;
 import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.getNodeIdFromSchemaId;
@@ -866,7 +867,7 @@
     @Override
     public SchemaContext getChildContext(SchemaId schemaId) {
 
-        checkNotNull(schemaId);
+        checkNotNull(schemaId, E_ID);
         YangSchemaNodeIdentifier id = getNodeIdFromSchemaId(
                 schemaId, getNameSpace().getModuleNamespace());
         try {
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangOutput.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangOutput.java
index ca49cd9..427029f 100644
--- a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangOutput.java
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangOutput.java
@@ -35,6 +35,7 @@
 import static org.onosproject.yang.compiler.datamodel.exceptions.ErrorMessages.COLLISION_DETECTION;
 import static org.onosproject.yang.compiler.datamodel.exceptions.ErrorMessages.OUTPUT;
 import static org.onosproject.yang.compiler.datamodel.exceptions.ErrorMessages.getErrorMsgCollision;
+import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.E_ID;
 import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.FMT_NOT_EXIST;
 import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.detectCollidingChildUtil;
 import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.errorMsg;
@@ -271,7 +272,7 @@
     @Override
     public SchemaContext getChildContext(SchemaId schemaId) {
 
-        checkNotNull(schemaId);
+        checkNotNull(schemaId, E_ID);
         YangSchemaNodeIdentifier id = getNodeIdFromSchemaId(
                 schemaId, getNameSpace().getModuleNamespace());
         try {
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangRpc.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangRpc.java
index 2b96956..70d22c7 100644
--- a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangRpc.java
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangRpc.java
@@ -36,6 +36,7 @@
 import static org.onosproject.yang.compiler.datamodel.exceptions.ErrorMessages.COLLISION_DETECTION;
 import static org.onosproject.yang.compiler.datamodel.exceptions.ErrorMessages.RPC;
 import static org.onosproject.yang.compiler.datamodel.exceptions.ErrorMessages.getErrorMsgCollision;
+import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.E_ID;
 import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.FMT_NOT_EXIST;
 import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.detectCollidingChildUtil;
 import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.errorMsg;
@@ -228,7 +229,7 @@
     @Override
     public SchemaContext getChildContext(SchemaId schemaId) {
 
-        checkNotNull(schemaId);
+        checkNotNull(schemaId, E_ID);
         YangSchemaNodeIdentifier id = getNodeIdFromSchemaId(
                 schemaId, getNameSpace().getModuleNamespace());
         try {
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/utils/DataModelUtils.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/utils/DataModelUtils.java
index 30122ec..c9dba2c 100644
--- a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/utils/DataModelUtils.java
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/utils/DataModelUtils.java
@@ -116,6 +116,7 @@
     public static final String FMT_NOT_EXIST =
             "Requested %s is not child in %s.";
     private static final String E_DATATYPE = "Data type not supported.";
+    public static final String E_ID = "Schema id should not be null.";
 
     /**
      * Creates a new data model tree utility.
diff --git a/runtime/src/main/java/org/onosproject/yang/runtime/helperutils/SerializerHelper.java b/runtime/src/main/java/org/onosproject/yang/runtime/helperutils/SerializerHelper.java
index 4449d5c..8a97560 100644
--- a/runtime/src/main/java/org/onosproject/yang/runtime/helperutils/SerializerHelper.java
+++ b/runtime/src/main/java/org/onosproject/yang/runtime/helperutils/SerializerHelper.java
@@ -107,10 +107,6 @@
         try {
             SchemaContext child = getChildSchemaContext(
                     (SchemaContext) builder.appInfo(), name, namespace);
-            if (child == null) {
-                throw new IllegalArgumentException(
-                        errorMsg(FMT_NOT_EXIST, name));
-            }
             DataNode.Type type = child.getType();
             updateResourceId(builder, name, value, child, type);
         } catch (IllegalArgumentException e) {
@@ -440,6 +436,10 @@
 
         SchemaId id = new SchemaId(name, namespace);
         child = ((SingleInstanceNodeContext) context).getChildContext(id);
+        if (child == null) {
+            throw new IllegalArgumentException(
+                    errorMsg(FMT_NOT_EXIST, name));
+        }
         return child;
     }
 
diff --git a/runtime/src/main/java/org/onosproject/yang/runtime/ymrimpl/DefaultYangModelRegistry.java b/runtime/src/main/java/org/onosproject/yang/runtime/ymrimpl/DefaultYangModelRegistry.java
index 0f0d8a6..566fefc 100644
--- a/runtime/src/main/java/org/onosproject/yang/runtime/ymrimpl/DefaultYangModelRegistry.java
+++ b/runtime/src/main/java/org/onosproject/yang/runtime/ymrimpl/DefaultYangModelRegistry.java
@@ -548,6 +548,10 @@
 
         String namespace = schemaId.namespace();
         YangSchemaNode node = getForNameSpace(namespace);
+        if (node == null) {
+            //If namespace if module name.
+            node = getForSchemaName(schemaId.namespace());
+        }
         YangSchemaNodeIdentifier id = getNodeIdFromSchemaId(
                 schemaId, namespace);
 
@@ -556,7 +560,7 @@
                 return node.getChildSchema(id).getSchemaNode();
             }
         } catch (DataModelException e) {
-            e.printStackTrace();
+            log.error("failed to get child schema", e);
         }
         return null;
     }
diff --git a/runtime/src/test/java/org/onosproject/yang/runtime/impl/TestUtils.java b/runtime/src/test/java/org/onosproject/yang/runtime/impl/TestUtils.java
index b17981a..1dcb1c0 100644
--- a/runtime/src/test/java/org/onosproject/yang/runtime/impl/TestUtils.java
+++ b/runtime/src/test/java/org/onosproject/yang/runtime/impl/TestUtils.java
@@ -51,6 +51,15 @@
     }
 
     public static final String PERIOD = ".";
+    public static final String IETFNS =
+            "urn:ietf:params:xml:ns:yang:yrt-ietf-network";
+    public static final String IETFNAME = "yrt-ietf-network";
+    public static final String TOPONS =
+            "urn:ietf:params:xml:ns:yang:yrt-ietf-network-topology";
+    public static final String LNS = "yrt:list";
+    public static final String L_NAME = "list";
+    public static final String LMNG = "yrt.Logistics-manager";
+    public static final String LMNG_N = "Logistics-manager";
 
     // Logger list is used for walker testing.
     private static final List<String> LOGGER = new ArrayList<>();
diff --git a/runtime/src/test/java/org/onosproject/yang/runtime/impl/schemacontext/SchemaContextTest.java b/runtime/src/test/java/org/onosproject/yang/runtime/impl/schemacontext/SchemaContextTest.java
index e1e473a..1b3d3de 100644
--- a/runtime/src/test/java/org/onosproject/yang/runtime/impl/schemacontext/SchemaContextTest.java
+++ b/runtime/src/test/java/org/onosproject/yang/runtime/impl/schemacontext/SchemaContextTest.java
@@ -29,6 +29,8 @@
 
 import java.util.List;
 
+import static org.onosproject.yang.runtime.impl.TestUtils.IETFNS;
+import static org.onosproject.yang.runtime.impl.TestUtils.TOPONS;
 import static org.onosproject.yang.runtime.impl.TestUtils.checkLeafSchemaContext;
 import static org.onosproject.yang.runtime.impl.TestUtils.checkSchemaContext;
 
@@ -40,11 +42,6 @@
     private static TestYangSchemaNodeProvider schemaProvider =
             new TestYangSchemaNodeProvider();
 
-    public static final String IETFNS =
-            "urn:ietf:params:xml:ns:yang:yrt-ietf-network";
-    public static final String TOPONS =
-            "urn:ietf:params:xml:ns:yang:yrt-ietf-network-topology";
-
     /**
      * Validates the getting schema context by schema Id scenario.
      */
diff --git a/runtime/src/test/java/org/onosproject/yang/runtime/impl/serializerhelper/AddToDataNodeIetfNetTest.java b/runtime/src/test/java/org/onosproject/yang/runtime/impl/serializerhelper/AddToDataNodeIetfNetTest.java
index 43b75b2..d3fe554 100644
--- a/runtime/src/test/java/org/onosproject/yang/runtime/impl/serializerhelper/AddToDataNodeIetfNetTest.java
+++ b/runtime/src/test/java/org/onosproject/yang/runtime/impl/serializerhelper/AddToDataNodeIetfNetTest.java
@@ -26,9 +26,10 @@
 import static org.onosproject.yang.runtime.helperutils.SerializerHelper.exitDataNode;
 import static org.onosproject.yang.runtime.helperutils.SerializerHelper.getResourceId;
 import static org.onosproject.yang.runtime.helperutils.SerializerHelper.initializeDataNode;
-import static org.onosproject.yang.runtime.impl.TestUtils.walkINTree;
-import static org.onosproject.yang.runtime.impl.schemacontext.SchemaContextTest.IETFNS;
+import static org.onosproject.yang.runtime.impl.TestUtils.IETFNAME;
+import static org.onosproject.yang.runtime.impl.TestUtils.IETFNS;
 import static org.onosproject.yang.runtime.impl.TestUtils.validateResourceId;
+import static org.onosproject.yang.runtime.impl.TestUtils.walkINTree;
 
 /**
  * Tests the serializer helper methods.
@@ -104,7 +105,7 @@
 
         dBlr = initializeDataNode(context);
         // Adding container
-        dBlr = addDataNode(dBlr, "networks", IETFNS, value, null);
+        dBlr = addDataNode(dBlr, "networks", IETFNAME, value, null);
         // Adding list inside container
         dBlr = addDataNode(dBlr, "network", null, value, null);
         // Adding key element network Id
@@ -155,7 +156,7 @@
 
         value = null;
         // Adding container
-        dBlr = addDataNode(dBlr, "networks-state", IETFNS, value, null);
+        dBlr = addDataNode(dBlr, "networks-state", IETFNAME, value, null);
         // Adding list inside container
         dBlr = addDataNode(dBlr, "network", null, value, null);
         // Adding key element network-ref
diff --git a/runtime/src/test/java/org/onosproject/yang/runtime/impl/serializerhelper/AddToDataNodeLeafListTest.java b/runtime/src/test/java/org/onosproject/yang/runtime/impl/serializerhelper/AddToDataNodeLeafListTest.java
index 57618b9..9e0e289 100644
--- a/runtime/src/test/java/org/onosproject/yang/runtime/impl/serializerhelper/AddToDataNodeLeafListTest.java
+++ b/runtime/src/test/java/org/onosproject/yang/runtime/impl/serializerhelper/AddToDataNodeLeafListTest.java
@@ -27,6 +27,7 @@
 import static org.onosproject.yang.runtime.helperutils.SerializerHelper.getResourceId;
 import static org.onosproject.yang.runtime.helperutils.SerializerHelper.initializeDataNode;
 import static org.onosproject.yang.runtime.helperutils.SerializerHelper.initializeResourceId;
+import static org.onosproject.yang.runtime.impl.TestUtils.LNS;
 import static org.onosproject.yang.runtime.impl.TestUtils.validateDataNode;
 import static org.onosproject.yang.runtime.impl.TestUtils.validateResourceId;
 import static org.onosproject.yang.runtime.impl.TestUtils.walkINTree;
@@ -36,8 +37,6 @@
  */
 public class AddToDataNodeLeafListTest {
 
-    public static final String LNS = "yrt:list";
-
     TestYangSerializerContext context = new TestYangSerializerContext();
 
     /*
diff --git a/runtime/src/test/java/org/onosproject/yang/runtime/impl/serializerhelper/AddToDataNodeList1Test.java b/runtime/src/test/java/org/onosproject/yang/runtime/impl/serializerhelper/AddToDataNodeList1Test.java
index 3ce0be0..772a542 100644
--- a/runtime/src/test/java/org/onosproject/yang/runtime/impl/serializerhelper/AddToDataNodeList1Test.java
+++ b/runtime/src/test/java/org/onosproject/yang/runtime/impl/serializerhelper/AddToDataNodeList1Test.java
@@ -38,6 +38,8 @@
 import static org.onosproject.yang.runtime.helperutils.SerializerHelper.getResourceId;
 import static org.onosproject.yang.runtime.helperutils.SerializerHelper.initializeDataNode;
 import static org.onosproject.yang.runtime.helperutils.SerializerHelper.initializeResourceId;
+import static org.onosproject.yang.runtime.impl.TestUtils.LNS;
+import static org.onosproject.yang.runtime.impl.TestUtils.L_NAME;
 import static org.onosproject.yang.runtime.impl.TestUtils.validateDataNode;
 import static org.onosproject.yang.runtime.impl.TestUtils.validateLeafDataNode;
 import static org.onosproject.yang.runtime.impl.TestUtils.validateResourceId;
@@ -48,9 +50,6 @@
  */
 public class AddToDataNodeList1Test {
 
-
-    public static final String LNS = "yrt:list";
-
     TestYangSerializerContext context = new TestYangSerializerContext();
 
     /*
@@ -103,7 +102,7 @@
         ResourceId.Builder rIdBlr = initializeResourceId(context);
         dBlr = initializeDataNode(rIdBlr);
 
-        dBlr = addDataNode(dBlr, "l1", LNS, value, null);
+        dBlr = addDataNode(dBlr, "l1", L_NAME, value, null);
         value = "1";
         dBlr = addDataNode(dBlr, "k1", null, value, null);
         dBlr = exitDataNode(dBlr);
diff --git a/runtime/src/test/java/org/onosproject/yang/runtime/impl/serializerhelper/AddToDataNodeListTest.java b/runtime/src/test/java/org/onosproject/yang/runtime/impl/serializerhelper/AddToDataNodeListTest.java
index 510ca2e..84d11a4 100644
--- a/runtime/src/test/java/org/onosproject/yang/runtime/impl/serializerhelper/AddToDataNodeListTest.java
+++ b/runtime/src/test/java/org/onosproject/yang/runtime/impl/serializerhelper/AddToDataNodeListTest.java
@@ -38,6 +38,8 @@
 import static org.onosproject.yang.runtime.helperutils.SerializerHelper.exitDataNode;
 import static org.onosproject.yang.runtime.helperutils.SerializerHelper.getResourceId;
 import static org.onosproject.yang.runtime.helperutils.SerializerHelper.initializeDataNode;
+import static org.onosproject.yang.runtime.impl.TestUtils.LNS;
+import static org.onosproject.yang.runtime.impl.TestUtils.L_NAME;
 import static org.onosproject.yang.runtime.impl.TestUtils.validateDataNode;
 import static org.onosproject.yang.runtime.impl.TestUtils.validateLeafDataNode;
 import static org.onosproject.yang.runtime.impl.TestUtils.validateResourceId;
@@ -48,8 +50,6 @@
  */
 public class AddToDataNodeListTest {
 
-    public static final String LNS = "yrt:list";
-
     TestYangSerializerContext context = new TestYangSerializerContext();
 
     /*
@@ -111,7 +111,7 @@
     public void addToDataListTest() throws IOException {
         ResourceId id;
         dBlr = initializeDataNode(context);
-        dBlr = addDataNode(dBlr, "l1", LNS, value, null);
+        dBlr = addDataNode(dBlr, "l1", L_NAME, value, null);
         value = "1";
         dBlr = addDataNode(dBlr, "k1", null, value, null);
         dBlr = exitDataNode(dBlr);
@@ -141,16 +141,16 @@
 
         // Checking leaf list
         value = "1";
-        dBlr = addDataNode(dBlr, "leaf1", LNS, value, null);
+        dBlr = addDataNode(dBlr, "leaf1", L_NAME, value, null);
         dBlr = exitDataNode(dBlr);
         value = "2";
-        dBlr = addDataNode(dBlr, "leaf1", LNS, value, null);
+        dBlr = addDataNode(dBlr, "leaf1", L_NAME, value, null);
         dBlr = exitDataNode(dBlr);
         value = "3";
-        dBlr = addDataNode(dBlr, "leaf1", LNS, value, null);
+        dBlr = addDataNode(dBlr, "leaf1", L_NAME, value, null);
         dBlr = exitDataNode(dBlr);
         value = null;
-        dBlr = addDataNode(dBlr, "leaf1", LNS, value, null);
+        dBlr = addDataNode(dBlr, "leaf1", L_NAME, value, null);
         ResourceId id3 = getResourceId(dBlr);
         dBlr = exitDataNode(dBlr);
 
diff --git a/runtime/src/test/java/org/onosproject/yang/runtime/impl/serializerhelper/AddToDataNodeLogisticTest.java b/runtime/src/test/java/org/onosproject/yang/runtime/impl/serializerhelper/AddToDataNodeLogisticTest.java
index fc088d5..e2ea3bb 100644
--- a/runtime/src/test/java/org/onosproject/yang/runtime/impl/serializerhelper/AddToDataNodeLogisticTest.java
+++ b/runtime/src/test/java/org/onosproject/yang/runtime/impl/serializerhelper/AddToDataNodeLogisticTest.java
@@ -37,6 +37,8 @@
 import static org.onosproject.yang.runtime.helperutils.SerializerHelper.exitDataNode;
 import static org.onosproject.yang.runtime.helperutils.SerializerHelper.getResourceId;
 import static org.onosproject.yang.runtime.helperutils.SerializerHelper.initializeDataNode;
+import static org.onosproject.yang.runtime.impl.TestUtils.LMNG;
+import static org.onosproject.yang.runtime.impl.TestUtils.LMNG_N;
 import static org.onosproject.yang.runtime.impl.TestUtils.validateDataNode;
 import static org.onosproject.yang.runtime.impl.TestUtils.validateLeafDataNode;
 import static org.onosproject.yang.runtime.impl.TestUtils.validateResourceId;
@@ -47,8 +49,6 @@
  */
 public class AddToDataNodeLogisticTest {
 
-    public static final String LMNG = "yrt.Logistics-manager";
-
     TestYangSerializerContext context = new TestYangSerializerContext();
 
     /*
@@ -287,7 +287,7 @@
         dBlr = initializeDataNode(context);
 
         value = "1";
-        dBlr = addDataNode(dBlr, "Customs-supervisor", LMNG, value, null);
+        dBlr = addDataNode(dBlr, "Customs-supervisor", LMNG_N, value, null);
         id = getResourceId(dBlr);
         nA = new String[]{"/", "Customs-supervisor"};
         nsA = new String[]{null, LMNG};
@@ -306,10 +306,10 @@
         dBlr = exitDataNode(dBlr);
 
         value = null;
-        dBlr = addDataNode(dBlr, "Material-supervisor", LMNG, value, null);
+        dBlr = addDataNode(dBlr, "Material-supervisor", LMNG_N, value, null);
 
         value = "abc";
-        dBlr = addDataNode(dBlr, "name", LMNG, value, null);
+        dBlr = addDataNode(dBlr, "name", LMNG_N, value, null);
         dBlr = exitDataNode(dBlr);
 
         value = "dep-1";
@@ -333,7 +333,7 @@
         dBlr = addDataNode(dBlr, "Material-supervisor", LMNG, value, null);
 
         value = "abc1";
-        dBlr = addDataNode(dBlr, "name", LMNG, value, null);
+        dBlr = addDataNode(dBlr, "name", LMNG_N, value, null);
         dBlr = exitDataNode(dBlr);
 
         value = "dep-1";
@@ -342,7 +342,7 @@
         dBlr = exitDataNode(dBlr);
 
         value = null;
-        dBlr = addDataNode(dBlr, "Material-supervisor", LMNG, value, null);
+        dBlr = addDataNode(dBlr, "Material-supervisor", LMNG_N, value, null);
 
         value = "abc2";
         dBlr = addDataNode(dBlr, "name", LMNG, value, null);
@@ -359,7 +359,7 @@
         dBlr = exitDataNode(dBlr);
 
         value = null;
-        dBlr = addDataNode(dBlr, "Purchasing-supervisor", LMNG, value, null);
+        dBlr = addDataNode(dBlr, "Purchasing-supervisor", LMNG_N, value, null);
 
         value = "xyz";
         dBlr = addDataNode(dBlr, "purchasing-specialist", LMNG, value, null);
@@ -388,7 +388,7 @@
         dBlr = exitDataNode(dBlr);
 
         value = "2";
-        dBlr = addDataNode(dBlr, "Warehouse-supervisor", LMNG, value, null);
+        dBlr = addDataNode(dBlr, "Warehouse-supervisor", LMNG_N, value, null);
         dBlr = exitDataNode(dBlr);
 
         value = "3";
@@ -396,7 +396,7 @@
         dBlr = exitDataNode(dBlr);
 
         value = "4";
-        dBlr = addDataNode(dBlr, "Warehouse-supervisor", LMNG, value, null);
+        dBlr = addDataNode(dBlr, "Warehouse-supervisor", LMNG_N, value, null);
         dBlr = exitDataNode(dBlr);
 
         value = "1";
@@ -408,11 +408,11 @@
         dBlr = exitDataNode(dBlr);
 
         value = "2";
-        dBlr = addDataNode(dBlr, "Employee-id", LMNG, value, null);
+        dBlr = addDataNode(dBlr, "Employee-id", LMNG_N, value, null);
         dBlr = exitDataNode(dBlr);
 
         value = "3";
-        dBlr = addDataNode(dBlr, "Employee-id", LMNG, value, null);
+        dBlr = addDataNode(dBlr, "Employee-id", LMNG_N, value, null);
         dBlr = exitDataNode(dBlr);
 
         value = "4";
diff --git a/runtime/src/test/java/org/onosproject/yang/runtime/impl/serializerhelper/ResourceIdInitializationTest.java b/runtime/src/test/java/org/onosproject/yang/runtime/impl/serializerhelper/ResourceIdInitializationTest.java
index 66e8f31..defbc5f 100644
--- a/runtime/src/test/java/org/onosproject/yang/runtime/impl/serializerhelper/ResourceIdInitializationTest.java
+++ b/runtime/src/test/java/org/onosproject/yang/runtime/impl/serializerhelper/ResourceIdInitializationTest.java
@@ -23,9 +23,9 @@
 
 import static org.onosproject.yang.runtime.helperutils.SerializerHelper.addToResourceId;
 import static org.onosproject.yang.runtime.helperutils.SerializerHelper.initializeResourceId;
+import static org.onosproject.yang.runtime.impl.TestUtils.IETFNS;
 import static org.onosproject.yang.runtime.impl.TestUtils.checkRootLevelContext;
 import static org.onosproject.yang.runtime.impl.TestUtils.validateResourceId;
-import static org.onosproject.yang.runtime.impl.schemacontext.SchemaContextTest.IETFNS;
 
 /**
  * Tests the initialize resource id methods in serializer helper.