[ONOS-4799],[ONOS-4351] Augment inter file linker and Generated Code refactored.

Change-Id: Id1f3ac9c90a632373f51cc75d499c3110216be17
diff --git a/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/ietfyang/IetfYangFileTest.java b/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/ietfyang/IetfYangFileTest.java
index 49c5d60..7176760 100644
--- a/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/ietfyang/IetfYangFileTest.java
+++ b/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/ietfyang/IetfYangFileTest.java
@@ -16,16 +16,16 @@
 
 package org.onosproject.yangutils.ietfyang;
 
+import java.io.IOException;
+
 import org.apache.maven.plugin.MojoExecutionException;
 import org.junit.Test;
 import org.onosproject.yangutils.linker.impl.YangLinkerManager;
 import org.onosproject.yangutils.parser.exceptions.ParserException;
 import org.onosproject.yangutils.parser.impl.YangUtilsParserManager;
 import org.onosproject.yangutils.plugin.manager.YangUtilManager;
-import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
 import org.onosproject.yangutils.utils.io.impl.YangFileScanner;
-
-import java.io.IOException;
+import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
 
 import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory;
 
@@ -54,6 +54,7 @@
         String userDir = System.getProperty("user.dir");
         YangPluginConfig yangPluginConfig = new YangPluginConfig();
         yangPluginConfig.setCodeGenDir("target/ietfyang/l3vpnservice/");
+        yangPluginConfig.setManagerCodeGenDir("target/ietfyang/l3vpnservice/");
 
         utilManager.translateToJava(utilManager.getYangFileInfoSet(), yangPluginConfig);
 
diff --git a/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/parser/impl/listeners/AugmentListenerTest.java b/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/parser/impl/listeners/AugmentListenerTest.java
index 6c0930a..146f410 100644
--- a/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/parser/impl/listeners/AugmentListenerTest.java
+++ b/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/parser/impl/listeners/AugmentListenerTest.java
@@ -20,12 +20,12 @@
 import java.util.ListIterator;
 
 import org.junit.Test;
-import org.onosproject.yangutils.datamodel.YangNode;
-import org.onosproject.yangutils.datamodel.YangModule;
+import org.onosproject.yangutils.datamodel.YangAtomicPath;
 import org.onosproject.yangutils.datamodel.YangAugment;
-import org.onosproject.yangutils.datamodel.YangLeaf;
-import org.onosproject.yangutils.datamodel.YangNodeIdentifier;
 import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
+import org.onosproject.yangutils.datamodel.YangLeaf;
+import org.onosproject.yangutils.datamodel.YangModule;
+import org.onosproject.yangutils.datamodel.YangNode;
 import org.onosproject.yangutils.datamodel.YangNodeType;
 import org.onosproject.yangutils.parser.exceptions.ParserException;
 import org.onosproject.yangutils.parser.impl.YangUtilsParserManager;
@@ -48,16 +48,16 @@
 
         YangNode node = manager.getDataModel("src/test/resources/ValidAugmentStatement.yang");
 
-        assertThat((node instanceof YangModule), is(true));
+        assertThat(node instanceof YangModule, is(true));
         assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
         YangModule yangNode = (YangModule) node;
         assertThat(yangNode.getName(), is("Test"));
 
         YangAugment yangAugment = (YangAugment) yangNode.getChild();
-        ListIterator<YangNodeIdentifier> nodeIdentifierIterator = yangAugment.getTargetNode().listIterator();
-        YangNodeIdentifier yangNodeIdentifier = nodeIdentifierIterator.next();
-        assertThat(yangNodeIdentifier.getPrefix(), is("if"));
-        assertThat(yangNodeIdentifier.getName(), is("interfaces"));
+        ListIterator<YangAtomicPath> absPathIterator = yangAugment.getTargetNode().listIterator();
+        YangAtomicPath absPathIdentifier = absPathIterator.next();
+        assertThat(absPathIdentifier.getNodeIdentifier().getPrefix(), is("if"));
+        assertThat(absPathIdentifier.getNodeIdentifier().getName(), is("interfaces"));
 
         ListIterator<YangLeaf> leafIterator = yangAugment.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
diff --git a/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/AugmentTranslatorTest.java b/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/AugmentTranslatorTest.java
new file mode 100644
index 0000000..821a435
--- /dev/null
+++ b/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/AugmentTranslatorTest.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yangutils.plugin.manager;
+
+import java.io.IOException;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.junit.Test;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.utils.io.impl.YangFileScanner;
+import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
+
+import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory;
+
+/**
+ * Unit test case for augment translator.
+ */
+public class AugmentTranslatorTest {
+
+    private final YangUtilManager utilManager = new YangUtilManager();
+
+    /**
+     * Checks augment translation should not result in any exception.
+     *
+     * @throws MojoExecutionException
+     */
+    @Test
+    public void processAugmentTranslator() throws IOException, ParserException, MojoExecutionException {
+
+        String searchDir = "src/test/resources/augmentTranslator";
+        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        utilManager.parseYangFileInfoSet();
+        utilManager.createYangNodeSet();
+        utilManager.resolveDependenciesUsingLinker();
+
+        YangPluginConfig yangPluginConfig = new YangPluginConfig();
+        yangPluginConfig.setCodeGenDir("target/augmentTranslator/");
+        yangPluginConfig.setManagerCodeGenDir("target/augmentTranslator/");
+        utilManager.translateToJava(utilManager.getYangFileInfoSet(), yangPluginConfig);
+
+        deleteDirectory("target/augmentTranslator/");
+    }
+
+}
diff --git a/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/ChoiceCaseTranslatorTest.java b/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/ChoiceCaseTranslatorTest.java
index a9516eb..789bf94 100644
--- a/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/ChoiceCaseTranslatorTest.java
+++ b/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/ChoiceCaseTranslatorTest.java
@@ -44,6 +44,7 @@
 
         YangPluginConfig yangPluginConfig = new YangPluginConfig();
         yangPluginConfig.setCodeGenDir("target/ChoiceCaseTestGenFile/");
+        yangPluginConfig.setManagerCodeGenDir("target/ChoiceCaseTestGenFile/");
 
         generateJavaCode(node, yangPluginConfig);
 
diff --git a/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/EnumTranslatorTest.java b/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/EnumTranslatorTest.java
index c8784c8..3fbf50f 100644
--- a/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/EnumTranslatorTest.java
+++ b/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/EnumTranslatorTest.java
@@ -45,6 +45,7 @@
 
         YangPluginConfig yangPluginConfig = new YangPluginConfig();
         yangPluginConfig.setCodeGenDir("target/EnumTestGenFile/");
+        yangPluginConfig.setManagerCodeGenDir("target/EnumTestGenFile/");
 
         generateJavaCode(node, yangPluginConfig);
 
diff --git a/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/InterFileLinkingTest.java b/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/InterFileLinkingTest.java
index 1554c5f..b5fd40b 100644
--- a/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/InterFileLinkingTest.java
+++ b/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/InterFileLinkingTest.java
@@ -19,6 +19,7 @@
 import java.io.IOException;
 import java.util.Iterator;
 import java.util.ListIterator;
+
 import org.apache.maven.plugin.MojoExecutionException;
 import org.junit.Rule;
 import org.junit.Test;
@@ -171,7 +172,7 @@
         }
 
         // Check whether the data model tree returned is of type module.
-        assertThat((selfNode instanceof YangModule), is(true));
+        assertThat(selfNode instanceof YangModule, is(true));
 
         // Check whether the node type is set properly to module.
         assertThat(selfNode.getNodeType(), is(YangNodeType.MODULE_NODE));
@@ -184,7 +185,7 @@
         YangLeaf leafInfo;
 
         // Check whether grouping is the sibling of module's child.
-        assertThat((refNode.getChild() instanceof YangGrouping), is(true));
+        assertThat(refNode.getChild() instanceof YangGrouping, is(true));
 
         YangGrouping grouping = (YangGrouping) refNode.getChild();
         leafIterator = grouping.getListOfLeaf().listIterator();
@@ -196,7 +197,7 @@
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.STRING));
 
         // Check whether uses is module's child.
-        assertThat((yangNode.getChild() instanceof YangUses), is(true));
+        assertThat(yangNode.getChild() instanceof YangUses, is(true));
         YangUses uses = (YangUses) yangNode.getChild();
 
         // Check whether uses get resolved.
@@ -317,7 +318,7 @@
         }
 
         // Check whether the data model tree returned is of type module.
-        assertThat((selfNode instanceof YangModule), is(true));
+        assertThat(selfNode instanceof YangModule, is(true));
 
         // Check whether the node type is set properly to module.
         assertThat(selfNode.getNodeType(), is(YangNodeType.MODULE_NODE));
@@ -330,7 +331,7 @@
         YangLeaf leafInfo;
 
         // Check whether grouping is the sibling of module's child.
-        assertThat((refNode.getChild() instanceof YangGrouping), is(true));
+        assertThat(refNode.getChild() instanceof YangGrouping, is(true));
 
         YangGrouping grouping = (YangGrouping) refNode.getChild();
         leafIterator = grouping.getListOfLeaf().listIterator();
@@ -342,7 +343,7 @@
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.STRING));
 
         // Check whether uses is module's child.
-        assertThat((yangNode.getChild() instanceof YangUses), is(true));
+        assertThat(yangNode.getChild() instanceof YangUses, is(true));
         YangUses uses = (YangUses) yangNode.getChild();
 
         // Check whether uses get resolved.
@@ -637,13 +638,13 @@
         utilManager.parseYangFileInfoSet();
         utilManager.resolveDependenciesUsingLinker();
 
-        String userDir = System.getProperty("user.dir");
         YangPluginConfig yangPluginConfig = new YangPluginConfig();
         yangPluginConfig.setCodeGenDir("target/interfilewithusesreferringtype/");
+        yangPluginConfig.setManagerCodeGenDir("target/interfilewithusesreferringtype/");
 
         utilManager.translateToJava(utilManager.getYangFileInfoSet(), yangPluginConfig);
 
-        deleteDirectory(userDir + "/target/interfilewithusesreferringtype/");
+        deleteDirectory("target/interfilewithusesreferringtype/");
 
     }
 
@@ -659,17 +660,16 @@
         utilManager.parseYangFileInfoSet();
         utilManager.resolveDependenciesUsingLinker();
 
-        String userDir = System.getProperty("user.dir");
         YangPluginConfig yangPluginConfig = new YangPluginConfig();
         yangPluginConfig.setCodeGenDir("target/file1UsesFile2TypeDefFile3Type/");
+        yangPluginConfig.setManagerCodeGenDir("target/file1UsesFile2TypeDefFile3Type/");
 
         utilManager.translateToJava(utilManager.getYangFileInfoSet(), yangPluginConfig);
 
-        deleteDirectory(userDir + "/target/file1UsesFile2TypeDefFile3Type/");
+        deleteDirectory("target/file1UsesFile2TypeDefFile3Type/");
 
     }
 
-
     /**
      * Checks hierarchical intra with inter file type linking.
      */
@@ -682,17 +682,16 @@
         utilManager.parseYangFileInfoSet();
         utilManager.resolveDependenciesUsingLinker();
 
-        String userDir = System.getProperty("user.dir");
         YangPluginConfig yangPluginConfig = new YangPluginConfig();
         yangPluginConfig.setCodeGenDir("target/interfileietf/");
+        yangPluginConfig.setManagerCodeGenDir("target/interfileietf/");
 
         utilManager.translateToJava(utilManager.getYangFileInfoSet(), yangPluginConfig);
 
-        deleteDirectory(userDir + "/target/interfileietf/");
+        deleteDirectory("target/interfileietf/");
 
     }
 
-
     /**
      * Checks hierarchical intra with inter file type linking.
      */
@@ -705,17 +704,16 @@
         utilManager.parseYangFileInfoSet();
         utilManager.resolveDependenciesUsingLinker();
 
-        String userDir = System.getProperty("user.dir");
         YangPluginConfig yangPluginConfig = new YangPluginConfig();
         yangPluginConfig.setCodeGenDir("target/usesInContainer/");
+        yangPluginConfig.setManagerCodeGenDir("target/usesInContainer/");
 
         utilManager.translateToJava(utilManager.getYangFileInfoSet(), yangPluginConfig);
 
-        deleteDirectory(userDir + "/target/usesInContainer/");
+        deleteDirectory("target/usesInContainer/");
 
     }
 
-
     /**
      * Checks hierarchical intra with inter file type linking.
      */
@@ -728,13 +726,13 @@
         utilManager.parseYangFileInfoSet();
         utilManager.resolveDependenciesUsingLinker();
 
-        String userDir = System.getProperty("user.dir");
         YangPluginConfig yangPluginConfig = new YangPluginConfig();
         yangPluginConfig.setCodeGenDir("target/groupingNodeSameAsModule/");
+        yangPluginConfig.setManagerCodeGenDir("target/groupingNodeSameAsModule/");
 
         utilManager.translateToJava(utilManager.getYangFileInfoSet(), yangPluginConfig);
 
-        deleteDirectory(userDir + "/target/groupingNodeSameAsModule/");
+        deleteDirectory("target/groupingNodeSameAsModule/");
 
     }
 
@@ -846,7 +844,7 @@
 
         thrown.expect(LinkerException.class);
         thrown.expectMessage(
-                "YANG file error: Unable to find base leaf/leaf-list for given leafref");
+                "YANG file error: Unable to find base leaf/leaf-list for given leafref networks");
         String searchDir = "src/test/resources/interfileleafrefwithinvaliddestinationnode";
         utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
         utilManager.parseYangFileInfoSet();
diff --git a/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/InterJarLinkerTest.java b/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/InterJarLinkerTest.java
index cb9eff9..fcd2966 100644
--- a/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/InterJarLinkerTest.java
+++ b/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/InterJarLinkerTest.java
@@ -44,7 +44,7 @@
 import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.DERIVED;
 import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.STRING;
 import static org.onosproject.yangutils.datamodel.utils.ResolvableStatus.RESOLVED;
-import static org.onosproject.yangutils.plugin.manager.YangPluginUtils.deSerializeDataModel;
+import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.deSerializeDataModel;
 import static org.onosproject.yangutils.plugin.manager.YangPluginUtils.parseJarFile;
 import static org.onosproject.yangutils.plugin.manager.YangPluginUtils.serializeDataModel;
 import static org.onosproject.yangutils.utils.UtilConstants.SLASH;
@@ -189,6 +189,7 @@
 
         YangPluginConfig yangPluginConfig = new YangPluginConfig();
         yangPluginConfig.setCodeGenDir(TARGET);
+        yangPluginConfig.setManagerCodeGenDir(TARGET);
 
         utilManager.translateToJava(utilManager.getYangFileInfoSet(), yangPluginConfig);
 
@@ -205,7 +206,7 @@
         File folder = new File(System.getProperty("user.dir") + SLASH + FLOW_CLASSIFIER_FOLDER);
         File file = new File(System.getProperty("user.dir") + SLASH + FLOW_CLASSIFIER_MANAGER);
         assertThat(true, is(folder.exists()));
-        assertThat(true, is(file.exists()));
+        assertThat(false, is(file.exists()));
     }
 
     /**
diff --git a/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/IntraFileLeafrefLinkingTest.java b/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/IntraFileLeafrefLinkingTest.java
index 368d5f9..81a4e70 100644
--- a/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/IntraFileLeafrefLinkingTest.java
+++ b/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/IntraFileLeafrefLinkingTest.java
@@ -16,11 +16,17 @@
 
 package org.onosproject.yangutils.plugin.manager;
 
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ListIterator;
+
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
 import org.onosproject.yangutils.datamodel.YangAtomicPath;
 import org.onosproject.yangutils.datamodel.YangContainer;
+import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
 import org.onosproject.yangutils.datamodel.YangInput;
 import org.onosproject.yangutils.datamodel.YangLeaf;
 import org.onosproject.yangutils.datamodel.YangLeafList;
@@ -34,16 +40,10 @@
 import org.onosproject.yangutils.datamodel.YangPathPredicate;
 import org.onosproject.yangutils.datamodel.YangRelativePath;
 import org.onosproject.yangutils.datamodel.utils.ResolvableStatus;
-import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
 import org.onosproject.yangutils.linker.exceptions.LinkerException;
 import org.onosproject.yangutils.parser.exceptions.ParserException;
 import org.onosproject.yangutils.parser.impl.YangUtilsParserManager;
 
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.core.Is.is;
 import static org.hamcrest.core.IsNull.nullValue;
diff --git a/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/ManagerCodeGeneratorTest.java b/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/ManagerCodeGeneratorTest.java
new file mode 100644
index 0000000..817fb4e
--- /dev/null
+++ b/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/ManagerCodeGeneratorTest.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yangutils.plugin.manager;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.junit.Test;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.utils.io.impl.YangFileScanner;
+import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory;
+
+/**
+ * Unit test case to test code generation for root nodes.
+ */
+public class ManagerCodeGeneratorTest {
+
+    private final YangUtilManager utilManager = new YangUtilManager();
+
+    /**
+     * Checks manager translation should not result in any exception.
+     *
+     * @throws MojoExecutionException
+     */
+    @Test
+    public void processManagerTranslator() throws IOException, ParserException, MojoExecutionException {
+
+        String searchDir = "src/test/resources/manager";
+        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        utilManager.parseYangFileInfoSet();
+        utilManager.createYangNodeSet();
+        utilManager.resolveDependenciesUsingLinker();
+
+        YangPluginConfig yangPluginConfig = new YangPluginConfig();
+        yangPluginConfig.setCodeGenDir("target/manager/");
+        yangPluginConfig.setManagerCodeGenDir("target/manager/");
+
+        utilManager.translateToJava(utilManager.getYangFileInfoSet(), yangPluginConfig);
+        String file1 = "target/manager/org/onosproject/yang/gen/v1/test5/test/rev20160704/Test5Manager.java";
+        String file2 = "target/manager/org/onosproject/yang/gen/v1/test5/test/rev20160704/Test6Manager.java";
+        String file3 = "target/manager/org/onosproject/yang/gen/v1/test5/test/rev20160704/Test7Manager.java";
+        File manager = new File(file1);
+        assertThat(false, is(manager.exists()));
+
+        File manager2 = new File(file2);
+        assertThat(false, is(manager2.exists()));
+
+        File manager3 = new File(file3);
+        assertThat(true, is(manager3.exists()));
+
+        deleteDirectory("target/manager/");
+    }
+
+    /**
+     * Checks manager translation in different package should not result in any exception.
+     *
+     * @throws MojoExecutionException
+     */
+    @Test
+    public void processManagerInDifferentPackageTranslator() throws IOException, ParserException,
+            MojoExecutionException {
+
+        String searchDir = "src/test/resources/manager";
+        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        utilManager.parseYangFileInfoSet();
+        utilManager.createYangNodeSet();
+        utilManager.resolveDependenciesUsingLinker();
+
+        YangPluginConfig yangPluginConfig = new YangPluginConfig();
+        yangPluginConfig.setCodeGenDir("target/manager/");
+        yangPluginConfig.setManagerCodeGenDir("target/manager1/");
+
+        utilManager.translateToJava(utilManager.getYangFileInfoSet(), yangPluginConfig);
+        String file3 = "target/manager1/org/onosproject/yang/gen/v1/test5/test/rev20160704/Test7Manager.java";
+
+        File manager3 = new File(file3);
+        assertThat(true, is(manager3.exists()));
+
+        deleteDirectory("target/manager/");
+        deleteDirectory("target/manager1/");
+    }
+}
diff --git a/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/NotificationTranslatorTest.java b/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/NotificationTranslatorTest.java
index ab98c76..27b42e1 100644
--- a/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/NotificationTranslatorTest.java
+++ b/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/NotificationTranslatorTest.java
@@ -38,13 +38,14 @@
      * Checks union translation should not result in any exception.
      */
     @Test
-    public void processUnionTranslator()
+    public void processNotificationTranslator()
             throws IOException, ParserException {
 
         YangNode node = manager.getDataModel("src/test/resources/NotificationTest.yang");
 
         YangPluginConfig yangPluginConfig = new YangPluginConfig();
         yangPluginConfig.setCodeGenDir("target/NotificationTest/");
+        yangPluginConfig.setManagerCodeGenDir("target/NotificationTest1/");
 
         generateJavaCode(node, yangPluginConfig);
 
diff --git a/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/RpcTranslatorTest.java b/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/RpcTranslatorTest.java
index e34613d..078ea50 100644
--- a/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/RpcTranslatorTest.java
+++ b/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/RpcTranslatorTest.java
@@ -45,6 +45,7 @@
 
         YangPluginConfig yangPluginConfig = new YangPluginConfig();
         yangPluginConfig.setCodeGenDir("target/RpcTestGenFile/");
+        yangPluginConfig.setManagerCodeGenDir("target/RpcTestGenFile/");
 
         generateJavaCode(node, yangPluginConfig);
 
diff --git a/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/UnionTranslatorTest.java b/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/UnionTranslatorTest.java
index b892edd..46d4f67 100644
--- a/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/UnionTranslatorTest.java
+++ b/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/UnionTranslatorTest.java
@@ -45,6 +45,7 @@
 
         YangPluginConfig yangPluginConfig = new YangPluginConfig();
         yangPluginConfig.setCodeGenDir("target/UnionTestGenFile/");
+        yangPluginConfig.setManagerCodeGenDir("target/UnionTestGenFile/");
 
         generateJavaCode(node, yangPluginConfig);
 
diff --git a/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/YangPluginUtilsTest.java b/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/YangPluginUtilsTest.java
index a6e2e08..891a280 100644
--- a/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/YangPluginUtilsTest.java
+++ b/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/YangPluginUtilsTest.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package org.onosproject.yangutils.plugin.manager;
 
 import java.io.File;
@@ -11,7 +27,7 @@
 import static org.onosproject.yangutils.plugin.manager.YangPluginUtils.addToCompilationRoot;
 
 /**
- * Created by root1 on 16/6/16.
+ * Unit test case for YANG plugin utils.
  */
 public class YangPluginUtilsTest {
 
diff --git a/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/YangXpathLinkerTest.java b/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/YangXpathLinkerTest.java
new file mode 100644
index 0000000..946bac1
--- /dev/null
+++ b/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/YangXpathLinkerTest.java
@@ -0,0 +1,598 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package org.onosproject.yangutils.plugin.manager;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.junit.Test;
+import org.onosproject.yangutils.datamodel.ResolvableType;
+import org.onosproject.yangutils.datamodel.YangAugment;
+import org.onosproject.yangutils.datamodel.YangNode;
+import org.onosproject.yangutils.datamodel.YangReferenceResolver;
+import org.onosproject.yangutils.datamodel.YangResolutionInfo;
+import org.onosproject.yangutils.linker.impl.YangLinkerManager;
+import org.onosproject.yangutils.linker.impl.YangXpathLinker;
+import org.onosproject.yangutils.utils.io.impl.YangFileScanner;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+
+/**
+ * Unit test cases for x-path linker.
+ */
+public class YangXpathLinkerTest {
+
+    private YangUtilManager utilManager = new YangUtilManager();
+    private YangXpathLinker linker = new YangXpathLinker();
+    private YangLinkerManager linkerManager = new YangLinkerManager();
+    private static final String INTRA_FILE_PATH = "src/test/resources/xPathLinker/IntraFile/";
+    private static final String INTER_FILE_PATH = "src/test/resources/xPathLinker/InterFile/";
+
+    /**
+     * Unit test case for intra file linking for single level container.
+     *
+     * @throws IOException when fails to do IO operations
+     * @throws MojoExecutionException
+     */
+    @Test
+    public void processIntraFileLinkingSingleLevel() throws IOException, MojoExecutionException {
+
+        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(INTRA_FILE_PATH + "IntraSingle/"));
+        utilManager.parseYangFileInfoSet();
+        utilManager.createYangNodeSet();
+        utilManager.resolveDependenciesUsingLinker();
+
+        YangNode targetNode = null;
+        String targetNodeName = null;
+
+        for (YangNode node : utilManager.getYangNodeSet()) {
+            YangReferenceResolver ref = (YangReferenceResolver) node;
+            List<YangResolutionInfo> infos = ref.getUnresolvedResolutionList(ResolvableType.YANG_AUGMENT);
+            YangResolutionInfo info = infos.get(0);
+
+            YangAugment augment = (YangAugment) info.getEntityToResolveInfo().getEntityToResolve();
+            targetNodeName = augment.getTargetNode().get(augment.getTargetNode().size() - 1).getNodeIdentifier()
+                    .getName();
+            targetNode = augment.getAugmentedNode();
+
+        }
+
+        assertThat(true, is(targetNode.getName().equals(targetNodeName)));
+    }
+
+    /**
+     * Unit test case for intra file linking for multiple level container.
+     *
+     * @throws IOException when fails to do IO operations
+     */
+    @Test
+    public void processIntraFileLinkingMultipleLevel() throws IOException {
+
+        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(INTRA_FILE_PATH + "IntraMulti/"));
+        utilManager.parseYangFileInfoSet();
+        utilManager.createYangNodeSet();
+
+        YangNode targetNode = null;
+        String targetNodeName = null;
+
+        for (YangNode node : utilManager.getYangNodeSet()) {
+            List<YangAugment> augments = linker.getListOfYangAugment(node);
+
+            for (YangAugment augment : augments) {
+                targetNodeName = augment.getTargetNode().get(augment.getTargetNode().size() - 1).getNodeIdentifier()
+                        .getName();
+                targetNode = linker.processAugmentXpathLinking(augment.getTargetNode(), node);
+            }
+        }
+
+        assertThat(true, is(targetNode.getName().equals(targetNodeName)));
+    }
+
+    /**
+     * Unit test case for intra file linking for single level augment.
+     *
+     * @throws IOException when fails to do IO operations
+     */
+    @Test
+    public void processIntraFileLinkingInAugmentSingleLevel() throws IOException {
+        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(INTRA_FILE_PATH + "IntraSingleAugment/"));
+        utilManager.parseYangFileInfoSet();
+        utilManager.createYangNodeSet();
+
+        YangNode targetNode = null;
+        String targetNodeName = null;
+
+        for (YangNode node : utilManager.getYangNodeSet()) {
+            List<YangAugment> augments = linker.getListOfYangAugment(node);
+
+            for (YangAugment augment : augments) {
+                targetNodeName = augment.getTargetNode().get(augment.getTargetNode().size() - 1).getNodeIdentifier()
+                        .getName();
+                targetNode = linker.processAugmentXpathLinking(augment.getTargetNode(), node);
+            }
+        }
+
+        assertThat(true, is(targetNode.getName().equals(targetNodeName)));
+    }
+
+    /**
+     * Unit test case for intra file linking for multiple level augment.
+     *
+     * @throws IOException when fails to do IO operations
+     */
+    @Test
+    public void processIntraFileLinkingInAugmentMultiLevel() throws IOException {
+        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(INTRA_FILE_PATH + "IntraMultiAugment/"));
+        utilManager.parseYangFileInfoSet();
+        utilManager.createYangNodeSet();
+        linkerManager.createYangNodeSet(utilManager.getYangNodeSet());
+        linkerManager.addRefToYangFilesImportList(utilManager.getYangNodeSet());
+        linkerManager.addRefToYangFilesIncludeList(utilManager.getYangNodeSet());
+        linkerManager.processInterFileLinking(utilManager.getYangNodeSet());
+
+        YangNode targetNode = null;
+        String targetNodeName = null;
+
+        for (YangNode node : utilManager.getYangNodeSet()) {
+            List<YangAugment> augments = linker.getListOfYangAugment(node);
+
+            for (YangAugment augment : augments) {
+                targetNodeName = augment.getTargetNode().get(augment.getTargetNode().size() - 1).getNodeIdentifier()
+                        .getName();
+                targetNode = linker.processAugmentXpathLinking(augment.getTargetNode(), node);
+            }
+        }
+
+        assertThat(true, is(targetNode.getName().equals(targetNodeName)));
+
+    }
+
+    /**
+     * Unit test case for intra file linking for multiple level submodule.
+     *
+     * @throws IOException when fails to do IO operations
+     */
+    @Test
+    public void processIntraFileLinkingInSubModuleSingleLevel() throws IOException {
+        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(INTRA_FILE_PATH + "IntraSingleSubModule/"));
+        utilManager.parseYangFileInfoSet();
+        utilManager.createYangNodeSet();
+        linkerManager.createYangNodeSet(utilManager.getYangNodeSet());
+        linkerManager.linkSubModulesToParentModule(utilManager.getYangNodeSet());
+        linkerManager.addRefToYangFilesIncludeList(utilManager.getYangNodeSet());
+
+        YangNode targetNode = null;
+        String targetNodeName = null;
+
+        for (YangNode node : utilManager.getYangNodeSet()) {
+            List<YangAugment> augments = linker.getListOfYangAugment(node);
+
+            for (YangAugment augment : augments) {
+                targetNodeName = augment.getTargetNode().get(augment.getTargetNode().size() - 1).getNodeIdentifier()
+                        .getName();
+                targetNode = linker.processAugmentXpathLinking(augment.getTargetNode(), node);
+            }
+        }
+
+        assertThat(true, is(targetNode.getName().equals(targetNodeName)));
+    }
+
+    /**
+     * Unit test case for intra file linking for multiple level submodule.
+     *
+     * @throws IOException when fails to do IO operations
+     */
+    @Test
+    public void processIntraFileLinkingInSubModuleMultiLevel() throws IOException {
+
+        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(INTRA_FILE_PATH + "IntraMultiSubModule/"));
+        utilManager.parseYangFileInfoSet();
+        utilManager.createYangNodeSet();
+        linkerManager.createYangNodeSet(utilManager.getYangNodeSet());
+        linkerManager.linkSubModulesToParentModule(utilManager.getYangNodeSet());
+        linkerManager.addRefToYangFilesIncludeList(utilManager.getYangNodeSet());
+
+        YangNode targetNode = null;
+        String targetNodeName = null;
+
+        for (YangNode node : utilManager.getYangNodeSet()) {
+            List<YangAugment> augments = linker.getListOfYangAugment(node);
+
+            for (YangAugment augment : augments) {
+                targetNodeName = augment.getTargetNode().get(augment.getTargetNode().size() - 1).getNodeIdentifier()
+                        .getName();
+                targetNode = linker.processAugmentXpathLinking(augment.getTargetNode(), node);
+            }
+        }
+
+        assertThat(true, is(targetNode.getName().equals(targetNodeName)));
+    }
+
+    /**
+     * Unit test case for intra file linking for single level uses.
+     *
+     * @throws IOException when fails to do IO operations
+     */
+    @Test
+    public void processIntraFileLinkingInUsesSingleLevel() throws IOException {
+
+        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(INTRA_FILE_PATH + "IntraSingleUses/"));
+        utilManager.parseYangFileInfoSet();
+        utilManager.createYangNodeSet();
+        linkerManager.createYangNodeSet(utilManager.getYangNodeSet());
+        linkerManager.processInterFileLinking(utilManager.getYangNodeSet());
+
+        YangNode targetNode = null;
+        String targetNodeName = null;
+
+        for (YangNode node : utilManager.getYangNodeSet()) {
+            List<YangAugment> augments = linker.getListOfYangAugment(node);
+
+            for (YangAugment augment : augments) {
+                targetNodeName = augment.getTargetNode().get(augment.getTargetNode().size() - 1).getNodeIdentifier()
+                        .getName();
+                targetNode = linker.processAugmentXpathLinking(augment.getTargetNode(), node);
+            }
+        }
+
+        assertThat(true, is(targetNode.getName().equals(targetNodeName)));
+    }
+
+    /**
+     * Unit test case for intra file linking for multi level uses.
+     *
+     * @throws IOException when fails to do IO operations
+     */
+    @Test
+    public void processIntraFileLinkingInUsesMultiLevel() throws IOException {
+
+        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(INTRA_FILE_PATH + "IntraMultiUses/"));
+        utilManager.parseYangFileInfoSet();
+        utilManager.createYangNodeSet();
+        linkerManager.createYangNodeSet(utilManager.getYangNodeSet());
+        linkerManager.processInterFileLinking(utilManager.getYangNodeSet());
+
+        YangNode targetNode = null;
+        String targetNodeName = null;
+
+        for (YangNode node : utilManager.getYangNodeSet()) {
+            List<YangAugment> augments = linker.getListOfYangAugment(node);
+
+            for (YangAugment augment : augments) {
+                targetNodeName = augment.getTargetNode().get(augment.getTargetNode().size() - 1).getNodeIdentifier()
+                        .getName();
+                targetNode = linker.processAugmentXpathLinking(augment.getTargetNode(), node);
+            }
+        }
+
+        assertThat(true, is(targetNode.getName().equals(targetNodeName)));
+    }
+
+    /**
+     * Unit test case for inter file linking for single level container.
+     *
+     * @throws IOException when fails to do IO operations
+     */
+    @Test
+    public void processInterFileLinkingSingleLevel() throws IOException {
+
+        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(INTER_FILE_PATH + "InterSingle/"));
+        utilManager.parseYangFileInfoSet();
+        utilManager.createYangNodeSet();
+        linkerManager.createYangNodeSet(utilManager.getYangNodeSet());
+        linkerManager.addRefToYangFilesImportList(utilManager.getYangNodeSet());
+
+        YangNode targetNode = null;
+        String targetNodeName = null;
+
+        for (YangNode node : utilManager.getYangNodeSet()) {
+            List<YangAugment> augments = linker.getListOfYangAugment(node);
+
+            for (YangAugment augment : augments) {
+                targetNodeName = augment.getTargetNode().get(augment.getTargetNode().size() - 1).getNodeIdentifier()
+                        .getName();
+                targetNode = linker.processAugmentXpathLinking(augment.getTargetNode(), node);
+            }
+        }
+
+        assertThat(true, is(targetNode.getName().equals(targetNodeName)));
+    }
+
+    /**
+     * Unit test case for inter file linking for multi level container.
+     *
+     * @throws IOException when fails to do IO operations
+     */
+    @Test
+    public void processInterFileLinkingMultipleLevel() throws IOException {
+
+        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(INTER_FILE_PATH + "InterMulti/"));
+        utilManager.parseYangFileInfoSet();
+        utilManager.createYangNodeSet();
+        linkerManager.createYangNodeSet(utilManager.getYangNodeSet());
+        linkerManager.addRefToYangFilesImportList(utilManager.getYangNodeSet());
+
+        YangNode targetNode = null;
+        String targetNodeName = null;
+
+        for (YangNode node : utilManager.getYangNodeSet()) {
+            List<YangAugment> augments = linker.getListOfYangAugment(node);
+
+            for (YangAugment augment : augments) {
+                targetNodeName = augment.getTargetNode().get(augment.getTargetNode().size() - 1).getNodeIdentifier()
+                        .getName();
+                targetNode = linker.processAugmentXpathLinking(augment.getTargetNode(), node);
+            }
+        }
+
+        assertThat(true, is(targetNode.getName().equals(targetNodeName)));
+    }
+
+    /**
+     * Unit test case for inter file linking for single level augment.
+     *
+     * @throws IOException when fails to do IO operations
+     */
+    @Test
+    public void processInterFileLinkingInAugmentSingleLevel() throws IOException {
+
+        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(INTER_FILE_PATH + "InterSingleAugment/"));
+        utilManager.parseYangFileInfoSet();
+        utilManager.createYangNodeSet();
+        linkerManager.createYangNodeSet(utilManager.getYangNodeSet());
+        linkerManager.addRefToYangFilesImportList(utilManager.getYangNodeSet());
+
+        YangNode targetNode = null;
+        String targetNodeName = null;
+
+        for (YangNode node : utilManager.getYangNodeSet()) {
+            List<YangAugment> augments = linker.getListOfYangAugment(node);
+
+            for (YangAugment augment : augments) {
+                targetNodeName = augment.getTargetNode().get(augment.getTargetNode().size() - 1).getNodeIdentifier()
+                        .getName();
+                targetNode = linker.processAugmentXpathLinking(augment.getTargetNode(), node);
+            }
+        }
+
+        assertThat(true, is(targetNode.getName().equals(targetNodeName)));
+    }
+
+    /**
+     * Unit test case for inter file linking for multi level augment.
+     *
+     * @throws IOException when fails to do IO operations
+     */
+    @Test
+    public void processInterFileLinkingInAugmentMultiLevel() throws IOException {
+
+        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(INTER_FILE_PATH + "InterMultiAugment/"));
+        utilManager.parseYangFileInfoSet();
+        utilManager.createYangNodeSet();
+        linkerManager.createYangNodeSet(utilManager.getYangNodeSet());
+        linkerManager.addRefToYangFilesImportList(utilManager.getYangNodeSet());
+
+        YangNode targetNode = null;
+        String targetNodeName = null;
+
+        for (YangNode node : utilManager.getYangNodeSet()) {
+            List<YangAugment> augments = linker.getListOfYangAugment(node);
+
+            for (YangAugment augment : augments) {
+                targetNodeName = augment.getTargetNode().get(augment.getTargetNode().size() - 1).getNodeIdentifier()
+                        .getName();
+                targetNode = linker.processAugmentXpathLinking(augment.getTargetNode(), node);
+            }
+        }
+
+        assertThat(true, is(targetNode.getName().equals(targetNodeName)));
+    }
+
+    /**
+     * Unit test case for multipler inter file linking for single level augment.
+     *
+     * @throws IOException when fails to do IO operations
+     */
+    @Test
+    public void processMultiInterFileLinkingInAugmentSingleLevel() throws IOException {
+
+        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(INTER_FILE_PATH + "InterMultiFileAugment/"));
+        utilManager.parseYangFileInfoSet();
+        utilManager.createYangNodeSet();
+        linkerManager.createYangNodeSet(utilManager.getYangNodeSet());
+        linkerManager.addRefToYangFilesImportList(utilManager.getYangNodeSet());
+
+        YangNode targetNode = null;
+        String targetNodeName = null;
+
+        for (YangNode node : utilManager.getYangNodeSet()) {
+            List<YangAugment> augments = linker.getListOfYangAugment(node);
+
+            for (YangAugment augment : augments) {
+                targetNodeName = augment.getTargetNode().get(augment.getTargetNode().size() - 1).getNodeIdentifier()
+                        .getName();
+                targetNode = linker.processAugmentXpathLinking(augment.getTargetNode(), node);
+            }
+        }
+
+        assertThat(true, is(targetNode.getName().equals(targetNodeName)));
+    }
+
+    /**
+     * Unit test case for multiple inter file linking for multi level augment.
+     *
+     * @throws IOException when fails to do IO operations
+     */
+    @Test
+    public void processMultiInterFileLinkingInAugmentMultiLevel() throws IOException {
+
+        utilManager
+                .createYangFileInfoSet(YangFileScanner.getYangFiles(INTER_FILE_PATH + "InterMultiFileAugmentMulti/"));
+        utilManager.parseYangFileInfoSet();
+        utilManager.createYangNodeSet();
+        linkerManager.createYangNodeSet(utilManager.getYangNodeSet());
+        linkerManager.addRefToYangFilesImportList(utilManager.getYangNodeSet());
+
+        YangNode targetNode = null;
+        String targetNodeName = null;
+
+        for (YangNode node : utilManager.getYangNodeSet()) {
+            List<YangAugment> augments = linker.getListOfYangAugment(node);
+
+            for (YangAugment augment : augments) {
+                targetNodeName = augment.getTargetNode().get(augment.getTargetNode().size() - 1).getNodeIdentifier()
+                        .getName();
+                targetNode = linker.processAugmentXpathLinking(augment.getTargetNode(), node);
+            }
+        }
+
+        assertThat(true, is(targetNode.getName().equals(targetNodeName)));
+    }
+
+    /**
+     * Unit test case for inter file linking for single level submodule.
+     *
+     * @throws IOException when fails to do IO operations
+     */
+    @Test
+    public void processInterFileLinkingInSubModuleSingleLevel() throws IOException {
+
+        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(INTER_FILE_PATH + "InterSingleSubModule/"));
+        utilManager.parseYangFileInfoSet();
+        utilManager.createYangNodeSet();
+        linkerManager.createYangNodeSet(utilManager.getYangNodeSet());
+        linkerManager.linkSubModulesToParentModule(utilManager.getYangNodeSet());
+        linkerManager.addRefToYangFilesImportList(utilManager.getYangNodeSet());
+        linkerManager.addRefToYangFilesIncludeList(utilManager.getYangNodeSet());
+
+        YangNode targetNode = null;
+        String targetNodeName = null;
+
+        for (YangNode node : utilManager.getYangNodeSet()) {
+            List<YangAugment> augments = linker.getListOfYangAugment(node);
+
+            for (YangAugment augment : augments) {
+                targetNodeName = augment.getTargetNode().get(augment.getTargetNode().size() - 1).getNodeIdentifier()
+                        .getName();
+                targetNode = linker.processAugmentXpathLinking(augment.getTargetNode(), node);
+            }
+        }
+
+        assertThat(true, is(targetNode.getName().equals(targetNodeName)));
+    }
+
+    /**
+     * Unit test case for inter file linking for multi level submodule.
+     *
+     * @throws IOException when fails to do IO operations
+     */
+    @Test
+    public void processInterFileLinkingInSubModuleMultiLevel() throws IOException {
+
+        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(INTER_FILE_PATH + "InterMultiSubModule/"));
+        utilManager.parseYangFileInfoSet();
+        utilManager.createYangNodeSet();
+        linkerManager.createYangNodeSet(utilManager.getYangNodeSet());
+        linkerManager.linkSubModulesToParentModule(utilManager.getYangNodeSet());
+        linkerManager.addRefToYangFilesImportList(utilManager.getYangNodeSet());
+        linkerManager.addRefToYangFilesIncludeList(utilManager.getYangNodeSet());
+        linkerManager.processInterFileLinking(utilManager.getYangNodeSet());
+        YangNode targetNode = null;
+        String targetNodeName = null;
+
+        for (YangNode node : utilManager.getYangNodeSet()) {
+            List<YangAugment> augments = linker.getListOfYangAugment(node);
+
+            for (YangAugment augment : augments) {
+                targetNodeName = augment.getTargetNode().get(augment.getTargetNode().size() - 1).getNodeIdentifier()
+                        .getName();
+                targetNode = linker.processAugmentXpathLinking(augment.getTargetNode(), node);
+            }
+        }
+
+        assertThat(true, is(targetNode.getName().equals(targetNodeName)));
+    }
+
+    /**
+     * Unit test case for inter file linking for multi level uses inside augment.
+     *
+     * @throws IOException when fails to do IO operations
+     */
+    @Test
+    public void processInterFileLinkingInUsesInAugment() throws IOException {
+
+        /* FIXME: when uses cloning is done test it.
+        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(INTER_FILE_PATH + "InterSingleUses/"));
+        utilManager.parseYangFileInfoSet();
+        utilManager.createYangNodeSet();
+        linkerManager.createYangNodeSet(utilManager.getYangNodeSet());
+        linkerManager.addRefToYangFilesImportList(utilManager.getYangNodeSet());
+        linkerManager.addRefToYangFilesIncludeList(utilManager.getYangNodeSet());
+        linkerManager.processInterFileLinking(utilManager.getYangNodeSet());
+
+        YangNode targetNode = null;
+        String targetNodeName = null;
+
+        for (YangNode node : utilManager.getYangNodeSet()) {
+            List<YangAugment> augments = linker.getListOfYangAugment(node);
+
+            for (YangAugment augment : augments) {
+                targetNodeName = augment.getTargetNode().get(augment.getTargetNode().size() - 1)
+                .getNodeIdentifier().getName();
+                targetNode = linker.processXpathLinking(augment.getTargetNode(), node);
+            }
+        }
+
+        assertThat(true, is(targetNode.getName().equals(targetNodeName)));
+        */
+    }
+
+    /**
+     * Unit test case for inter file linking for multi level uses.
+     *
+     * @throws IOException when fails to do IO operations
+     */
+    @Test
+    public void processInterFileLinkingInUsesMultiLevel() throws IOException {
+
+        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(INTER_FILE_PATH + "InterMultiUses/"));
+        utilManager.parseYangFileInfoSet();
+        utilManager.createYangNodeSet();
+        linkerManager.createYangNodeSet(utilManager.getYangNodeSet());
+        linkerManager.addRefToYangFilesImportList(utilManager.getYangNodeSet());
+        linkerManager.addRefToYangFilesIncludeList(utilManager.getYangNodeSet());
+        linkerManager.processInterFileLinking(utilManager.getYangNodeSet());
+
+        YangNode targetNode = null;
+        String targetNodeName = null;
+
+        for (YangNode node : utilManager.getYangNodeSet()) {
+            List<YangAugment> augments = linker.getListOfYangAugment(node);
+
+            for (YangAugment augment : augments) {
+                targetNodeName = augment.getTargetNode().get(augment.getTargetNode().size() - 1).getNodeIdentifier()
+                        .getName();
+                targetNode = linker.processAugmentXpathLinking(augment.getTargetNode(), node);
+            }
+        }
+
+        assertThat(true, is(targetNode.getName().equals(targetNodeName)));
+    }
+
+}
diff --git a/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/translator/tojava/utils/ClassDefinitionGeneratorTest.java b/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/translator/tojava/utils/ClassDefinitionGeneratorTest.java
deleted file mode 100644
index 39d5205..0000000
--- a/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/translator/tojava/utils/ClassDefinitionGeneratorTest.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright 2016-present Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onosproject.yangutils.translator.tojava.utils;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-
-import org.junit.Test;
-
-import static org.hamcrest.core.Is.is;
-import static org.hamcrest.core.IsNot.not;
-import static org.junit.Assert.assertThat;
-import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.BUILDER_CLASS_MASK;
-import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.BUILDER_INTERFACE_MASK;
-import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_TYPEDEF_CLASS;
-import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.IMPL_CLASS_MASK;
-import static org.onosproject.yangutils.translator.tojava.utils.ClassDefinitionGenerator.generateClassDefinition;
-
-/**
- * Unit tests for class definition generator for generated files.
- */
-public final class ClassDefinitionGeneratorTest {
-
-    private static final String CLASS_NAME = "TestClass";
-    private static final String INTERFACE_CLASS_DEF = "public interface TestClass {\n";
-    private static final String BULDER_INTERFACE_CLASS_DEF = "interface TestClassBuilder {\n\n";
-    private static final String BUILDER_CLASS_DEF = "public class TestClassBuilder implements "
-            + "TestClass.TestClassBuilder {\n";
-    private static final String IMPL_CLASS_DEF = "public final class TestClassImpl implements TestClass {\n";
-    private static final String TYPE_DEF_CLASS_DEF = "public final class TestClass {\n";
-
-    /**
-     * Unit test for private constructor.
-     *
-     * @throws SecurityException if any security violation is observed
-     * @throws NoSuchMethodException if when the method is not found
-     * @throws IllegalArgumentException if there is illegal argument found
-     * @throws InstantiationException if instantiation is provoked for the private constructor
-     * @throws IllegalAccessException if instance is provoked or a method is provoked
-     * @throws InvocationTargetException when an exception occurs by the method or constructor
-     */
-    @Test
-    public void callPrivateConstructors()
-            throws SecurityException, NoSuchMethodException, IllegalArgumentException,
-            InstantiationException, IllegalAccessException, InvocationTargetException {
-
-        Class<?>[] classesToConstruct = {ClassDefinitionGenerator.class };
-        for (Class<?> clazz : classesToConstruct) {
-            Constructor<?> constructor = clazz.getDeclaredConstructor();
-            constructor.setAccessible(true);
-            assertThat(null, not(constructor.newInstance()));
-        }
-    }
-
-    /**
-     * Unit test for builder class definition.
-     */
-    @Test
-    public void generateBuilderClassDefinitionTest() {
-        String builderClassDefinition = generateClassDefinition(BUILDER_CLASS_MASK, CLASS_NAME);
-        assertThat(true, is(builderClassDefinition.equals(BUILDER_CLASS_DEF)));
-    }
-
-    /**
-     * Unit test for builder interface definition.
-     */
-    @Test
-    public void generateBuilderInterfaceDefinitionTest() {
-        String builderInterfaceDefinition = generateClassDefinition(BUILDER_INTERFACE_MASK, CLASS_NAME);
-        assertThat(true, is(builderInterfaceDefinition.equals(BULDER_INTERFACE_CLASS_DEF)));
-    }
-
-    /**
-     * Unit test for impl class definition.
-     */
-    @Test
-    public void generateImplDefinitionTest() {
-        String implDefinition = generateClassDefinition(IMPL_CLASS_MASK, CLASS_NAME);
-        assertThat(true, is(implDefinition.equals(IMPL_CLASS_DEF)));
-    }
-
-    /**
-     * Unit test for interface definition.
-     */
-    @Test
-    public void generateinterfaceDefinitionTest() {
-        // TODO: need to add this test case.
-    }
-
-    /**
-     * Unit test for typedef generated type.
-     */
-    @Test
-    public void generateTypeDefTest() {
-        String typeDef = generateClassDefinition(GENERATE_TYPEDEF_CLASS, CLASS_NAME);
-        assertThat(true, is(typeDef.equals(TYPE_DEF_CLASS_DEF)));
-    }
-}
diff --git a/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/translator/tojava/utils/MethodsGeneratorTest.java b/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/translator/tojava/utils/MethodsGeneratorTest.java
index d441c03..5a8f822 100644
--- a/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/translator/tojava/utils/MethodsGeneratorTest.java
+++ b/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/translator/tojava/utils/MethodsGeneratorTest.java
@@ -30,7 +30,6 @@
 import static org.junit.Assert.assertThat;
 import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.STRING;
 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_SERVICE_AND_MANAGER;
-import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCapitalCase;
 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getBuild;
 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getBuildForInterface;
 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getCheckNotNull;
@@ -58,7 +57,6 @@
 import static org.onosproject.yangutils.utils.UtilConstants.EQUALS_STRING;
 import static org.onosproject.yangutils.utils.UtilConstants.FOUR_SPACE_INDENTATION;
 import static org.onosproject.yangutils.utils.UtilConstants.GET_METHOD_PREFIX;
-import static org.onosproject.yangutils.utils.UtilConstants.IMPL;
 import static org.onosproject.yangutils.utils.UtilConstants.JAVA_LANG;
 import static org.onosproject.yangutils.utils.UtilConstants.NEW;
 import static org.onosproject.yangutils.utils.UtilConstants.NEW_LINE;
@@ -83,6 +81,7 @@
 import static org.onosproject.yangutils.utils.UtilConstants.TWELVE_SPACE_INDENTATION;
 import static org.onosproject.yangutils.utils.UtilConstants.VALUE;
 import static org.onosproject.yangutils.utils.UtilConstants.VOID;
+import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCapitalCase;
 
 /**
  * Unit tests for generated methods from the file type.
@@ -107,7 +106,7 @@
             throws SecurityException, NoSuchMethodException, IllegalArgumentException,
             InstantiationException, IllegalAccessException, InvocationTargetException {
 
-        Class<?>[] classesToConstruct = {MethodsGenerator.class };
+        Class<?>[] classesToConstruct = {MethodsGenerator.class};
         for (Class<?> clazz : classesToConstruct) {
             Constructor<?> constructor = clazz.getDeclaredConstructor();
             constructor.setAccessible(true);
@@ -135,7 +134,7 @@
         String method = getBuild(CLASS_NAME);
         assertThat(true, is(method.equals(FOUR_SPACE_INDENTATION + PUBLIC + SPACE + CLASS_NAME + SPACE + BUILD
                 + OPEN_PARENTHESIS + CLOSE_PARENTHESIS + SPACE + OPEN_CURLY_BRACKET + NEW_LINE + EIGHT_SPACE_INDENTATION
-                + RETURN + SPACE + NEW + SPACE + CLASS_NAME + IMPL + OPEN_PARENTHESIS + THIS + CLOSE_PARENTHESIS
+                + RETURN + SPACE + NEW + SPACE + "Default" + CLASS_NAME + OPEN_PARENTHESIS + THIS + CLOSE_PARENTHESIS
                 + SEMI_COLAN + NEW_LINE + FOUR_SPACE_INDENTATION + CLOSE_CURLY_BRACKET)));
 
     }
@@ -167,7 +166,7 @@
     public void getConstructorTest() {
         JavaAttributeInfo testAttr = getTestAttribute();
         YangPluginConfig pluginConfig = new YangPluginConfig();
-        String method = getConstructor(CLASS_NAME, testAttr, GENERATE_SERVICE_AND_MANAGER, pluginConfig);
+        String method = getConstructor(testAttr, GENERATE_SERVICE_AND_MANAGER, pluginConfig);
         assertThat(true, is(method.contains(THIS + PERIOD + CLASS_NAME + SPACE + EQUAL + SPACE + "builder" + OBJECT
                 + PERIOD + GET_METHOD_PREFIX + "Testname" + OPEN_PARENTHESIS + CLOSE_PARENTHESIS + SEMI_COLAN)));
     }
@@ -179,7 +178,7 @@
     public void getConstructorStartTest() {
         YangPluginConfig pluginConfig = new YangPluginConfig();
         String method = getConstructorStart(CLASS_NAME, pluginConfig);
-        assertThat(true, is(method.contains(PUBLIC + SPACE + CLASS_NAME + IMPL + OPEN_PARENTHESIS + CLASS_NAME
+        assertThat(true, is(method.contains(PUBLIC + SPACE + "Default" + CLASS_NAME + OPEN_PARENTHESIS + CLASS_NAME
                 + BUILDER + SPACE + BUILDER.toLowerCase() + OBJECT + CLOSE_PARENTHESIS + SPACE
                 + OPEN_CURLY_BRACKET + NEW_LINE)));
     }