YANG: Line number and character position addition for cardinality failure + Increase readability of Error message and function name
Change-Id: I467a536a9d2a6cbb29873491fdb0a91f211deefd
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 a9add7a..b150f81 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
@@ -120,7 +120,8 @@
@Test
public void processLeafListConfigInvalidCardinality() throws IOException, ParserException {
thrown.expect(ParserException.class);
- thrown.expectMessage("YANG file error: Invalid cardinality of config in leaf-list \"invalid-interval\".");
+ thrown.expectMessage("YANG file error: \"config\" is defined more than once in \"leaf-list " +
+ "invalid-interval\".");
YangNode node = manager.getDataModel("src/test/resources/LeafListConfigInvalidCardinality.yang");
}
@@ -131,7 +132,7 @@
@Test
public void processLeafListUnitsInvalidCardinality() throws IOException, ParserException {
thrown.expect(ParserException.class);
- thrown.expectMessage("YANG file error: Invalid cardinality of units in leaf-list \"invalid-interval\".");
+ thrown.expectMessage("YANG file error: \"units\" is defined more than once in \"leaf-list invalid-interval\"");
YangNode node = manager.getDataModel("src/test/resources/LeafListUnitsInvalidCardinality.yang");
}