Improve {Bug394,TwoRevisions}Test
[yangtools.git] / parser / yang-parser-rfc7950 / src / test / java / org / opendaylight / yangtools / yang / stmt / TwoRevisionsTest.java
1 /*
2  * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.yangtools.yang.stmt;
9
10 import static org.junit.Assert.assertEquals;
11 import static org.junit.Assert.assertFalse;
12 import static org.junit.Assert.assertTrue;
13
14 import org.junit.Test;
15 import org.opendaylight.yangtools.yang.common.Revision;
16
17 public class TwoRevisionsTest {
18     @Test
19     public void testTwoRevisions() throws Exception {
20         var it = TestUtils.loadModules("/ietf").findModuleStatements("network-topology").iterator();
21         assertTrue(it.hasNext());
22         assertEquals(Revision.ofNullable("2013-10-21"), it.next().localQNameModule().getRevision());
23         assertTrue(it.hasNext());
24         assertEquals(Revision.ofNullable("2013-07-12"), it.next().localQNameModule().getRevision());
25         assertFalse(it.hasNext());
26     }
27 }