Deprecate simple DataTreeFactory.create()
[yangtools.git] / parser / yang-parser-rfc7950 / src / test / java / org / opendaylight / yangtools / yang / stmt / ImportRevisionsTest.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.hamcrest.CoreMatchers.startsWith;
11
12 import org.junit.jupiter.api.Test;
13
14 class ImportRevisionsTest extends AbstractYangTest {
15     @Test
16     void equalRevisionDatesTest() {
17         assertEffectiveModel(
18             "/import-revision-date-test/root-with-equal-revision-date.yang",
19             "/import-revision-date-test/imported-module-with-equal-revision-date.yang");
20     }
21
22     @Test
23     void unequalRevisionDatesTest() {
24         assertInferenceException(
25             startsWith("Imported module [imported-module-with-unequal-revision-date] was not found. [at "),
26             "/import-revision-date-test/root-with-unequal-revision-date.yang",
27             "/import-revision-date-test/imported-module-with-unequal-revision-date.yang");
28     }
29
30     @Test
31     void revisionDatesInRootOnlyTest() {
32         assertInferenceException(
33             startsWith("Imported module [imported-module-without-revision-date] was not found. [at "),
34             "/import-revision-date-test/root-with-revision-date.yang",
35             "/import-revision-date-test/imported-module-without-revision-date.yang");
36     }
37
38     @Test
39     void revisionDatesInImportedOnlyTest() {
40         assertEffectiveModel(
41             "/import-revision-date-test/root-without-revision-date.yang",
42             "/import-revision-date-test/imported-module-with-revision-date.yang");
43     }
44
45     @Test
46     void noRevisionInRootAndImportedTest() {
47         assertEffectiveModel(
48             "/import-revision-date-test/root-with-no-revision-date.yang",
49             "/import-revision-date-test/imported-module-with-no-revision-date.yang");
50     }
51 }