diff --git a/plugin/src/test/java/org/onosproject/yangutils/ietfyang/IetfYangFileTest.java b/plugin/src/test/java/org/onosproject/yangutils/ietfyang/IetfYangFileTest.java
index 49c5d60..7176760 100644
--- a/plugin/src/test/java/org/onosproject/yangutils/ietfyang/IetfYangFileTest.java
+++ b/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/plugin/src/test/java/org/onosproject/yangutils/parser/impl/listeners/AugmentListenerTest.java b/plugin/src/test/java/org/onosproject/yangutils/parser/impl/listeners/AugmentListenerTest.java
index 6c0930a..146f410 100644
--- a/plugin/src/test/java/org/onosproject/yangutils/parser/impl/listeners/AugmentListenerTest.java
+++ b/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/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/AugmentTranslatorTest.java b/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/AugmentTranslatorTest.java
new file mode 100644
index 0000000..821a435
--- /dev/null
+++ b/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/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/ChoiceCaseTranslatorTest.java b/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/ChoiceCaseTranslatorTest.java
index a9516eb..789bf94 100644
--- a/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/ChoiceCaseTranslatorTest.java
+++ b/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/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/EnumTranslatorTest.java b/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/EnumTranslatorTest.java
index c8784c8..3fbf50f 100644
--- a/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/EnumTranslatorTest.java
+++ b/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/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/InterFileLinkingTest.java b/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/InterFileLinkingTest.java
index 1554c5f..b5fd40b 100644
--- a/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/InterFileLinkingTest.java
+++ b/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/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/InterJarLinkerTest.java b/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/InterJarLinkerTest.java
index cb9eff9..fcd2966 100644
--- a/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/InterJarLinkerTest.java
+++ b/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/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/IntraFileLeafrefLinkingTest.java b/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/IntraFileLeafrefLinkingTest.java
index 368d5f9..81a4e70 100644
--- a/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/IntraFileLeafrefLinkingTest.java
+++ b/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/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/ManagerCodeGeneratorTest.java b/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/ManagerCodeGeneratorTest.java
new file mode 100644
index 0000000..817fb4e
--- /dev/null
+++ b/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/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/NotificationTranslatorTest.java b/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/NotificationTranslatorTest.java
index ab98c76..27b42e1 100644
--- a/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/NotificationTranslatorTest.java
+++ b/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/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/RpcTranslatorTest.java b/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/RpcTranslatorTest.java
index e34613d..078ea50 100644
--- a/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/RpcTranslatorTest.java
+++ b/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/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/UnionTranslatorTest.java b/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/UnionTranslatorTest.java
index b892edd..46d4f67 100644
--- a/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/UnionTranslatorTest.java
+++ b/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/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/YangPluginUtilsTest.java b/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/YangPluginUtilsTest.java
index a6e2e08..891a280 100644
--- a/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/YangPluginUtilsTest.java
+++ b/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/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/YangXpathLinkerTest.java b/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/YangXpathLinkerTest.java
new file mode 100644
index 0000000..946bac1
--- /dev/null
+++ b/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/plugin/src/test/java/org/onosproject/yangutils/translator/tojava/utils/ClassDefinitionGeneratorTest.java b/plugin/src/test/java/org/onosproject/yangutils/translator/tojava/utils/ClassDefinitionGeneratorTest.java
deleted file mode 100644
index 39d5205..0000000
--- a/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/plugin/src/test/java/org/onosproject/yangutils/translator/tojava/utils/MethodsGeneratorTest.java b/plugin/src/test/java/org/onosproject/yangutils/translator/tojava/utils/MethodsGeneratorTest.java
index d441c03..5a8f822 100644
--- a/plugin/src/test/java/org/onosproject/yangutils/translator/tojava/utils/MethodsGeneratorTest.java
+++ b/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)));
     }
