[ONOS-4650][ONOS-4726][ONOS-4727] [ONOS-4728]Implement must parser + when parser + feature + if-feature + revision defect fix
Change-Id: I0a3aee6c1c6b72ef7da7f7f565fd0f149fe3fd42
diff --git a/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/parser/impl/listeners/ImportListenerTest.java b/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/parser/impl/listeners/ImportListenerTest.java
index 9797e5e..b52da4a 100644
--- a/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/parser/impl/listeners/ImportListenerTest.java
+++ b/utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/parser/impl/listeners/ImportListenerTest.java
@@ -16,14 +16,15 @@
package org.onosproject.yangutils.parser.impl.listeners;
+import java.io.IOException;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
import org.junit.Test;
import org.onosproject.yangutils.datamodel.YangModule;
import org.onosproject.yangutils.datamodel.YangNode;
import org.onosproject.yangutils.parser.exceptions.ParserException;
import org.onosproject.yangutils.parser.impl.YangUtilsParserManager;
-import java.io.IOException;
-
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
@@ -33,6 +34,8 @@
public class ImportListenerTest {
private final YangUtilsParserManager manager = new YangUtilsParserManager();
+ private static final String DATE_FORMAT = "yyyy-MM-dd";
+ private final SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DATE_FORMAT);
/**
* Checks if mandatory parameter prefix is present in import.
@@ -65,12 +68,12 @@
* Checks if import listener updates the data model tree.
*/
@Test
- public void processImportValidEntry() throws IOException, ParserException {
+ public void processImportValidEntry() throws IOException, ParserException, ParseException {
YangNode node = manager.getDataModel("src/test/resources/ImportValidEntry.yang");
// Checks for the revision value in data model tree.
- assertThat(((YangModule) node).getImportList().get(0).getRevision(), is("2015-02-03"));
+ assertThat(((YangModule) node).getImportList().get(0).getRevision(), is(simpleDateFormat.parse("2015-02-03")));
// Checks for the prefix id in data model tree.
assertThat(((YangModule) node).getImportList().get(0).getPrefixId(), is("On2"));
// Checks for the module name in data model tree.