diff --git a/src/test/java/org/onosproject/yangutils/parser/impl/TreeWalkListenerTest.java b/src/test/java/org/onosproject/yangutils/parser/impl/TreeWalkListenerTest.java
new file mode 100644
index 0000000..cebd680
--- /dev/null
+++ b/src/test/java/org/onosproject/yangutils/parser/impl/TreeWalkListenerTest.java
@@ -0,0 +1,55 @@
+/*
+ * 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.parser.impl;
+
+import java.io.IOException;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+
+/**
+ * Test cases for testing tree walk listener functionality.
+ */
+public class TreeWalkListenerTest {
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    @Rule
+    public ExpectedException thrown = ExpectedException.none();
+    /**
+     * Checks whether exception is thrown for ordered statement.
+     */
+    @Test
+    public void processOrderedByStatement() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("YANG file error : \"ordered-by\" is not supported in current version, please check wiki" +
+                " for YANG utils road map.");
+        manager.getDataModel("src/test/resources/OrderedByStatement.yang");
+    }
+
+    /**
+     * Checks whether exception is thrown for anyxml statement.
+     */
+    @Test
+    public void processAnyXmlStatement() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("YANG file error : \"anyxml\" is not supported.");
+        manager.getDataModel("src/test/resources/AnyxmlStatement.yang");
+    }
+}
diff --git a/src/test/java/org/onosproject/yangutils/parser/impl/listeners/ConfigListenerTest.java b/src/test/java/org/onosproject/yangutils/parser/impl/listeners/ConfigListenerTest.java
index 439832f..d129e38 100644
--- a/src/test/java/org/onosproject/yangutils/parser/impl/listeners/ConfigListenerTest.java
+++ b/src/test/java/org/onosproject/yangutils/parser/impl/listeners/ConfigListenerTest.java
@@ -134,9 +134,9 @@
     @Test
     public void processModuleSubStatementConfig() throws IOException, ParserException {
         thrown.expect(ParserException.class);
-        thrown.expectMessage("mismatched input 'config' expecting {'augment', 'choice', 'contact', 'container',"
-                + " 'description', 'extension', 'deviation', 'feature', 'grouping', 'identity', 'import', 'include', "
-                + "'leaf', 'leaf-list', 'list', 'notification', 'organization', 'reference',"
+        thrown.expectMessage("mismatched input 'config' expecting {'anyxml', 'augment', 'choice', 'contact', "
+                + "'container', 'description', 'extension', 'deviation', 'feature', 'grouping', 'identity', 'import',"
+                + " 'include', 'leaf', 'leaf-list', 'list', 'notification', 'organization', 'reference',"
                 + " 'revision', 'rpc', 'typedef', 'uses', '}'}");
         YangNode node = manager.getDataModel("src/test/resources/ModuleSubStatementConfig.yang");
     }
diff --git a/src/test/java/org/onosproject/yangutils/parser/impl/listeners/DefaultListenerTest.java b/src/test/java/org/onosproject/yangutils/parser/impl/listeners/DefaultListenerTest.java
new file mode 100644
index 0000000..2aab556
--- /dev/null
+++ b/src/test/java/org/onosproject/yangutils/parser/impl/listeners/DefaultListenerTest.java
@@ -0,0 +1,90 @@
+/*
+ * 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.parser.impl.listeners;
+
+import java.io.IOException;
+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.YangLeaf;
+import org.onosproject.yangutils.datamodel.YangChoice;
+import org.onosproject.yangutils.datamodel.YangContainer;
+import org.onosproject.yangutils.datamodel.YangNodeType;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.YangUtilsParserManager;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+
+/**
+ * Test cases for testing default listener functionality.
+ */
+public class DefaultListenerTest {
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks if default value is set correctly.
+     */
+    @Test
+    public void processLeafSubStatementDefault() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/LeafSubStatementDefault.yang");
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.getDefaultValueInString(), is("\"1\""));
+    }
+
+    /**
+     * Checks if default value is set correctly.
+     */
+    @Test
+    public void processChoiceSubStatementDefault() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ChoiceSubStatementDefault.yang");
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        YangContainer yangContainer = (YangContainer) yangNode.getChild();
+        assertThat(yangContainer.getName(), is("food"));
+
+        YangChoice yangChoice = (YangChoice) yangContainer.getChild();
+        assertThat(yangChoice.getName(), is("snack"));
+        assertThat(yangChoice.getDefaultValueInString(), is("\"hello\""));
+    }
+}
diff --git a/src/test/java/org/onosproject/yangutils/parser/impl/listeners/EnumListenerTest.java b/src/test/java/org/onosproject/yangutils/parser/impl/listeners/EnumListenerTest.java
index 6f13667..a78c65f 100644
--- a/src/test/java/org/onosproject/yangutils/parser/impl/listeners/EnumListenerTest.java
+++ b/src/test/java/org/onosproject/yangutils/parser/impl/listeners/EnumListenerTest.java
@@ -18,7 +18,10 @@
 
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.core.Is.is;
+
+import org.junit.Rule;
 import org.junit.Test;
+import org.junit.rules.ExpectedException;
 import org.onosproject.yangutils.datamodel.YangDataTypes;
 import org.onosproject.yangutils.datamodel.YangEnum;
 import org.onosproject.yangutils.datamodel.YangEnumeration;
@@ -38,6 +41,9 @@
  */
 public class EnumListenerTest {
 
+    @Rule
+    public ExpectedException thrown = ExpectedException.none();
+
     private final YangUtilsParserManager manager = new YangUtilsParserManager();
 
     /**
@@ -84,7 +90,28 @@
      */
     @Test(expected = ParserException.class)
     public void processEnumWithDuplicateName() throws IOException, ParserException {
-
         YangNode node = manager.getDataModel("src/test/resources/EnumWithDuplicateName.yang");
     }
+
+    /**
+     * Checks enum boundary value.
+     */
+    @Test
+    public void processEnumBoundaryValue() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("YANG file error : value value 21474836472147483647 is not valid.");
+        YangNode node = manager.getDataModel("src/test/resources/EnumBoundaryValue.yang");
+    }
+
+    /**
+     * Checks whether exception is thrown if value is not specified following max enum value.
+     */
+    @Test
+    public void processEnumMaxNextValue() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("YANG file error : "
+                + "An enum value MUST be specified for enum substatements following the one"
+                + "with the current highest value");
+        YangNode node = manager.getDataModel("src/test/resources/EnumMaxNextValue.yang");
+    }
 }
diff --git a/src/test/java/org/onosproject/yangutils/parser/impl/listeners/KeyListenerTest.java b/src/test/java/org/onosproject/yangutils/parser/impl/listeners/KeyListenerTest.java
index 37b4733..510b313 100644
--- a/src/test/java/org/onosproject/yangutils/parser/impl/listeners/KeyListenerTest.java
+++ b/src/test/java/org/onosproject/yangutils/parser/impl/listeners/KeyListenerTest.java
@@ -203,12 +203,32 @@
     }
 
     /**
+     * Checks key values are set correctly.
+     */
+    @Test
+    public void processKeyWithUsesInList() throws IOException, ParserException {
+        YangNode node = manager.getDataModel("src/test/resources/KeyWithUsesInList.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the list is child of module
+        YangList yangList = (YangList) yangNode.getChild().getNextSibling();
+        assertThat(yangList.getName(), is("valid"));
+
+        ListIterator<String> keyList = yangList.getKeyList().listIterator();
+        assertThat(keyList.next(), is("invalid-interval"));
+    }
+
+    /**
      * Checks whether exception is thrown when key leaf identifier is not found in list.
      */
     @Test
     public void processInvalidLeafIdentifier() throws IOException, ParserException {
         thrown.expect(ParserException.class);
-        thrown.expectMessage("Leaf identifier must refer to a child leaf of the list");
+        thrown.expectMessage("An identifier, in key, must refer to a child leaf of the list");
         YangNode node = manager.getDataModel("src/test/resources/InvalidLeafIdentifier.yang");
     }
 
@@ -218,7 +238,7 @@
     @Test
     public void processInvalidLeafListIdentifier() throws IOException, ParserException {
         thrown.expect(ParserException.class);
-        thrown.expectMessage("Leaf-list identifier must refer to a child leaf of the list");
+        thrown.expectMessage("An identifier, in key, must refer to a child leaf of the list");
         YangNode node = manager.getDataModel("src/test/resources/InvalidLeafListIdentifier.yang");
     }
 
diff --git a/src/test/java/org/onosproject/yangutils/parser/impl/listeners/LeafListListenerTest.java b/src/test/java/org/onosproject/yangutils/parser/impl/listeners/LeafListListenerTest.java
index fe918fa..8e7489b 100644
--- a/src/test/java/org/onosproject/yangutils/parser/impl/listeners/LeafListListenerTest.java
+++ b/src/test/java/org/onosproject/yangutils/parser/impl/listeners/LeafListListenerTest.java
@@ -94,9 +94,9 @@
     @Test
     public void processLeafListInvalidStatement() throws IOException, ParserException {
         thrown.expect(ParserException.class);
-        thrown.expectMessage("mismatched input 'leaflist' expecting {'augment', 'choice', 'contact', 'container',"
-                + " 'description', 'extension', 'deviation', 'feature', 'grouping', 'identity', 'import', 'include',"
-                + " 'leaf', 'leaf-list', 'list', 'notification', 'organization', 'reference',"
+        thrown.expectMessage("mismatched input 'leaflist' expecting {'anyxml', 'augment', 'choice', 'contact', "
+                + "'container', 'description', 'extension', 'deviation', 'feature', 'grouping', 'identity', 'import',"
+                + " 'include', 'leaf', 'leaf-list', 'list', 'notification', 'organization', 'reference',"
                 + " 'revision', 'rpc', 'typedef', 'uses', '}'}");
         YangNode node = manager.getDataModel("src/test/resources/LeafListInvalidStatement.yang");
     }
diff --git a/src/test/java/org/onosproject/yangutils/parser/impl/listeners/LeafListenerTest.java b/src/test/java/org/onosproject/yangutils/parser/impl/listeners/LeafListenerTest.java
index 186d549..b330e53 100644
--- a/src/test/java/org/onosproject/yangutils/parser/impl/listeners/LeafListenerTest.java
+++ b/src/test/java/org/onosproject/yangutils/parser/impl/listeners/LeafListenerTest.java
@@ -95,9 +95,9 @@
     @Test
     public void processLeafInvalidStatement() throws IOException, ParserException {
         thrown.expect(ParserException.class);
-        thrown.expectMessage("mismatched input 'leafs' expecting {'augment', 'choice', 'contact', 'container',"
-                + " 'description', 'extension', 'deviation', 'feature', 'grouping', 'identity', 'import', 'include',"
-                + " 'leaf', 'leaf-list', 'list', 'notification', 'organization', 'reference',"
+        thrown.expectMessage("mismatched input 'leafs' expecting {'anyxml', 'augment', 'choice', 'contact', "
+                + "'container', 'description', 'extension', 'deviation', 'feature', 'grouping', 'identity', 'import',"
+                + " 'include', 'leaf', 'leaf-list', 'list', 'notification', 'organization', 'reference',"
                 + " 'revision', 'rpc', 'typedef', 'uses', '}'}");
         YangNode node = manager.getDataModel("src/test/resources/LeafInvalidStatement.yang");
     }
diff --git a/src/test/java/org/onosproject/yangutils/parser/impl/listeners/LengthRestrictionListenerTest.java b/src/test/java/org/onosproject/yangutils/parser/impl/listeners/LengthRestrictionListenerTest.java
index 3c01335..40036f5 100644
--- a/src/test/java/org/onosproject/yangutils/parser/impl/listeners/LengthRestrictionListenerTest.java
+++ b/src/test/java/org/onosproject/yangutils/parser/impl/listeners/LengthRestrictionListenerTest.java
@@ -232,4 +232,39 @@
                 " 18446744073709551615.");
         YangNode node = manager.getDataModel("src/test/resources/LengthWithInvalidInterval.yang");
     }
+
+    /**
+     * Checks valid length substatements.
+     */
+    @Test
+    public void processLengthSubStatements() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/LengthSubStatements.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("string"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.STRING));
+        YangStringRestriction stringRestriction = (YangStringRestriction) leafInfo
+                .getDataType().getDataTypeExtendedInfo();
+        YangRangeRestriction lengthRestriction = stringRestriction.getLengthRestriction();
+
+        assertThat(lengthRestriction.getDescription(), is("\"length description\""));
+        assertThat(lengthRestriction.getReference(), is("\"length reference\""));
+
+        ListIterator<YangRangeInterval> lengthListIterator = lengthRestriction.getAscendingRangeIntervals()
+                .listIterator();
+
+        YangRangeInterval rangeInterval = lengthListIterator.next();
+
+        assertThat(((YangUint64) rangeInterval.getStartValue()).getValue(), is(BigInteger.valueOf(0)));
+        assertThat(((YangUint64) rangeInterval.getEndValue()).getValue(), is(BigInteger.valueOf(100)));
+    }
 }
diff --git a/src/test/java/org/onosproject/yangutils/parser/impl/listeners/MandatoryListenerTest.java b/src/test/java/org/onosproject/yangutils/parser/impl/listeners/MandatoryListenerTest.java
index 246d4b0..52e43a9 100644
--- a/src/test/java/org/onosproject/yangutils/parser/impl/listeners/MandatoryListenerTest.java
+++ b/src/test/java/org/onosproject/yangutils/parser/impl/listeners/MandatoryListenerTest.java
@@ -148,9 +148,9 @@
     @Test
     public void processModuleSubStatementMandatory() throws IOException, ParserException {
         thrown.expect(ParserException.class);
-        thrown.expectMessage("mismatched input 'mandatory' expecting {'augment', 'choice', 'contact', 'container',"
-                + " 'description', 'extension', 'deviation', 'feature', 'grouping', 'identity', 'import', 'include',"
-                + " 'leaf', 'leaf-list', 'list', 'notification', 'organization', 'reference',"
+        thrown.expectMessage("mismatched input 'mandatory' expecting {'anyxml', 'augment', 'choice', 'contact',"
+                + " 'container', 'description', 'extension', 'deviation', 'feature', 'grouping', 'identity', 'import',"
+                + " 'include', 'leaf', 'leaf-list', 'list', 'notification', 'organization', 'reference',"
                 + " 'revision', 'rpc', 'typedef', 'uses', '}'}");
         YangNode node = manager.getDataModel("src/test/resources/ModuleSubStatementMandatory.yang");
     }
diff --git a/src/test/java/org/onosproject/yangutils/parser/impl/listeners/PatternRestrictionListenerTest.java b/src/test/java/org/onosproject/yangutils/parser/impl/listeners/PatternRestrictionListenerTest.java
index 00db373..928af5c 100644
--- a/src/test/java/org/onosproject/yangutils/parser/impl/listeners/PatternRestrictionListenerTest.java
+++ b/src/test/java/org/onosproject/yangutils/parser/impl/listeners/PatternRestrictionListenerTest.java
@@ -166,4 +166,32 @@
                 .getPatternList().listIterator();
         assertThat(patternListIterator.next(), is("-[0-9]+|[0-9]+"));
     }
+
+    /**
+     * Checks valid pattern substatement.
+     */
+    @Test
+    public void processPatternSubStatements() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/PatternSubStatements.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("string"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.STRING));
+        YangStringRestriction stringRestriction = (YangStringRestriction) leafInfo
+                .getDataType().getDataTypeExtendedInfo();
+        assertThat(stringRestriction.getDescription(), is("\"pattern description\""));
+        assertThat(stringRestriction.getReference(), is("\"pattern reference\""));
+        ListIterator<String> patternListIterator = stringRestriction.getPatternRestriction()
+                .getPatternList().listIterator();
+        assertThat(patternListIterator.next(), is("[a-zA-Z]"));
+    }
 }
diff --git a/src/test/java/org/onosproject/yangutils/parser/impl/listeners/RangeRestrictionListenerTest.java b/src/test/java/org/onosproject/yangutils/parser/impl/listeners/RangeRestrictionListenerTest.java
index 76da997..88672fd 100644
--- a/src/test/java/org/onosproject/yangutils/parser/impl/listeners/RangeRestrictionListenerTest.java
+++ b/src/test/java/org/onosproject/yangutils/parser/impl/listeners/RangeRestrictionListenerTest.java
@@ -174,4 +174,37 @@
         thrown.expectMessage("YANG file error : Input value \"a\" is not a valid int32.");
         YangNode node = manager.getDataModel("src/test/resources/RangeWithInvalidIntegerPattern.yang");
     }
+
+    /**
+     * Checks valid range statement with description.
+     */
+    @Test
+    public void processRangeSubStatements() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/RangeSubStatements.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("int32"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.INT32));
+        YangRangeRestriction rangeRestriction = (YangRangeRestriction) leafInfo
+                .getDataType().getDataTypeExtendedInfo();
+
+        assertThat(rangeRestriction.getDescription(), is("\"range description\""));
+        assertThat(rangeRestriction.getReference(), is("\"range reference\""));
+
+        ListIterator<YangRangeInterval> rangeListIterator = rangeRestriction.getAscendingRangeIntervals()
+                .listIterator();
+        YangRangeInterval rangeInterval = rangeListIterator.next();
+        assertThat(((YangInt32) rangeInterval.getStartValue()).getValue(), is(1));
+        assertThat(((YangInt32) rangeInterval.getEndValue()).getValue(), is(4));
+        assertThat(((YangInt32) rangeInterval.getEndValue()).getValue(), is(4));
+    }
 }
diff --git a/src/test/java/org/onosproject/yangutils/parser/impl/listeners/StatusListenerTest.java b/src/test/java/org/onosproject/yangutils/parser/impl/listeners/StatusListenerTest.java
index 7f0d1ea..b2cbd71 100644
--- a/src/test/java/org/onosproject/yangutils/parser/impl/listeners/StatusListenerTest.java
+++ b/src/test/java/org/onosproject/yangutils/parser/impl/listeners/StatusListenerTest.java
@@ -150,9 +150,9 @@
     @Test
     public void processModuleSubStatementStatus() throws IOException, ParserException {
         thrown.expect(ParserException.class);
-        thrown.expectMessage("mismatched input 'status' expecting {'augment', 'choice', 'contact', 'container', "
-                + "'description', 'extension', 'deviation', 'feature', 'grouping', 'identity', 'import', 'include',"
-                + " 'leaf', 'leaf-list', 'list', 'notification', 'organization', 'reference', "
+        thrown.expectMessage("mismatched input 'status' expecting {'anyxml', 'augment', 'choice', 'contact', "
+                + "'container', 'description', 'extension', 'deviation', 'feature', 'grouping', 'identity', 'import',"
+                + " 'include', 'leaf', 'leaf-list', 'list', 'notification', 'organization', 'reference', "
                 + "'revision', 'rpc', 'typedef', 'uses', '}'}");
         YangNode node = manager.getDataModel("src/test/resources/ModuleSubStatementStatus.yang");
     }
diff --git a/src/test/java/org/onosproject/yangutils/parser/impl/listeners/UnitsListenerTest.java b/src/test/java/org/onosproject/yangutils/parser/impl/listeners/UnitsListenerTest.java
index 6479991..6684df5 100644
--- a/src/test/java/org/onosproject/yangutils/parser/impl/listeners/UnitsListenerTest.java
+++ b/src/test/java/org/onosproject/yangutils/parser/impl/listeners/UnitsListenerTest.java
@@ -76,9 +76,9 @@
     @Test
     public void processModuleSubStatementUnits() throws IOException, ParserException {
         thrown.expect(ParserException.class);
-        thrown.expectMessage("mismatched input 'type' expecting {'augment', 'choice', 'contact', 'container', "
-                + "'description', 'extension', 'deviation', 'feature', 'grouping', 'identity', 'import', "
-                + "'include', 'leaf', 'leaf-list', 'list', 'notification', 'organization', "
+        thrown.expectMessage("mismatched input 'type' expecting {'anyxml', 'augment', 'choice', 'contact', "
+                + "'container', 'description', 'extension', 'deviation', 'feature', 'grouping', 'identity',"
+                + " 'import', 'include', 'leaf', 'leaf-list', 'list', 'notification', 'organization', "
                 + "'reference', 'revision', 'rpc', 'typedef', 'uses', '}'}");
         YangNode node = manager.getDataModel("src/test/resources/ModuleSubStatementUnits.yang");
     }
diff --git a/src/test/java/org/onosproject/yangutils/parser/impl/listeners/ValueListenerTest.java b/src/test/java/org/onosproject/yangutils/parser/impl/listeners/ValueListenerTest.java
index f0d5357..6dae702 100644
--- a/src/test/java/org/onosproject/yangutils/parser/impl/listeners/ValueListenerTest.java
+++ b/src/test/java/org/onosproject/yangutils/parser/impl/listeners/ValueListenerTest.java
@@ -80,6 +80,84 @@
     }
 
     /**
+     * Checks explicitly configured negative value.
+     */
+    @Test
+    public void processValueStatementWithNegativeValue() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ValueStatementWithNegativeValue.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("speed"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("enumeration"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.ENUMERATION));
+        assertThat(((YangEnumeration) leafInfo.getDataType().getDataTypeExtendedInfo()).getName(),
+                is("speed_enum"));
+
+        Set<YangEnum> enumSet = ((YangEnumeration) leafInfo.getDataType().getDataTypeExtendedInfo()).getEnumSet();
+        for (YangEnum tmp : enumSet) {
+            if (tmp.getNamedValue().equals("10m")) {
+                assertThat(tmp.getValue(), is(-2));
+            } else if (tmp.getNamedValue().equals("100m")) {
+                assertThat(tmp.getValue(), is(-1));
+            } else if (tmp.getNamedValue().equals("auto")) {
+                assertThat(tmp.getValue(), is(0));
+            }
+        }
+    }
+
+    /**
+     * Checks explicitly configured value with double quotes.
+     */
+    @Test
+    public void processValueStatementWithQuotes() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ValueStatementWithQuotes.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("speed"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("enumeration"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.ENUMERATION));
+        assertThat(((YangEnumeration) leafInfo.getDataType().getDataTypeExtendedInfo()).getName(),
+                is("speed_enum"));
+
+        Set<YangEnum> enumSet = ((YangEnumeration) leafInfo.getDataType().getDataTypeExtendedInfo()).getEnumSet();
+        for (YangEnum tmp : enumSet) {
+            if (tmp.getNamedValue().equals("10m")) {
+                assertThat(tmp.getValue(), is(10));
+            } else if (tmp.getNamedValue().equals("100m")) {
+                assertThat(tmp.getValue(), is(100));
+            } else if (tmp.getNamedValue().equals("auto")) {
+                assertThat(tmp.getValue(), is(1000));
+            }
+        }
+    }
+
+    /**
      * Checks explicit value and auto generated value.
      */
     @Test
diff --git a/src/test/java/org/onosproject/yangutils/utils/io/impl/YangFileScannerTest.java b/src/test/java/org/onosproject/yangutils/utils/io/impl/YangFileScannerTest.java
index d3137b3..7d199b9 100644
--- a/src/test/java/org/onosproject/yangutils/utils/io/impl/YangFileScannerTest.java
+++ b/src/test/java/org/onosproject/yangutils/utils/io/impl/YangFileScannerTest.java
@@ -26,6 +26,7 @@
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
+import org.onosproject.yangutils.plugin.manager.YangFileInfo;
 
 import static org.hamcrest.core.Is.is;
 import static org.hamcrest.core.IsNot.not;
@@ -135,7 +136,7 @@
 
         String emptyYangDir = baseDir + separator + "scanner1";
         File path = createDirectory(emptyYangDir);
-        List<String> emptyDirContents = getYangFiles(path.toString());
+        List<YangFileInfo> emptyDirContents = getYangFiles(path.toString());
         List<String> expectedContents = new LinkedList<>();
         assertThat(true, is(emptyDirContents.equals(expectedContents)));
     }
