Improve {Bug394,TwoRevisions}Test
[yangtools.git] / parser / yang-parser-rfc7950 / src / test / java / org / opendaylight / yangtools / yang / stmt / TwoRevisionsTest.java
index 1a1eee60d5593d81e7fb6186dd5a256b1533e030..8046fec2658dfe143829d7a6a596db528deea7da 100644 (file)
@@ -8,17 +8,20 @@
 package org.opendaylight.yangtools.yang.stmt;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
-import java.util.Collection;
 import org.junit.Test;
-import org.opendaylight.yangtools.yang.model.api.Module;
+import org.opendaylight.yangtools.yang.common.Revision;
 
 public class TwoRevisionsTest {
     @Test
     public void testTwoRevisions() throws Exception {
-        Collection<? extends Module> modules = TestUtils.loadModules(getClass().getResource("/ietf").toURI())
-                .getModules();
-        //FIXME: following assert needs module revisions .equals() solution first
-        assertEquals(2, TestUtils.findModules(modules, "network-topology").size());
+        var it = TestUtils.loadModules("/ietf").findModuleStatements("network-topology").iterator();
+        assertTrue(it.hasNext());
+        assertEquals(Revision.ofNullable("2013-10-21"), it.next().localQNameModule().getRevision());
+        assertTrue(it.hasNext());
+        assertEquals(Revision.ofNullable("2013-07-12"), it.next().localQNameModule().getRevision());
+        assertFalse(it.hasNext());
     }
 }