Bug 4640: Change semantic-version to openconfig-version
[yangtools.git] / yang / yang-parser-impl / src / test / java / org / opendaylight / yangtools / yang / stmt / openconfigver / OpenconfigVersionImportTest.java
@@ -5,7 +5,7 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-package org.opendaylight.yangtools.yang.stmt.semver;
+package org.opendaylight.yangtools.yang.stmt.openconfigver;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
@@ -21,65 +21,65 @@ import org.opendaylight.yangtools.yang.model.repo.api.StatementParserMode;
 import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
 import org.opendaylight.yangtools.yang.stmt.StmtTestUtils;
 
-public class SemanticVersionImportTest {
+public class OpenconfigVersionImportTest {
 
     @Test
     public void importValidTest() throws Exception {
-        SchemaContext context = StmtTestUtils.parseYangSources("/semantic-version/import/import-valid",
-                StatementParserMode.SEMVER_MODE);
+        SchemaContext context = StmtTestUtils.parseYangSources("/openconfig-version/import/import-valid",
+                StatementParserMode.OPENCONFIG_VER_MODE);
         assertNotNull(context);
 
-        Module semVer = context.findModuleByNamespace(new URI("urn:opendaylight:yang:extension:semantic-version"))
+        Module semVer = context.findModuleByNamespace(new URI("http://openconfig.net/yang/openconfig-ext"))
                 .iterator().next();
 
-        assertEquals(SemVer.valueOf("1.0.0"), semVer.getSemanticVersion());
+        assertEquals(SemVer.valueOf("1.0.0"), semVer.getOpenconfigVersion());
     }
 
     @Test
     public void importInvalidDeprecatedTest1() throws Exception {
         try {
-            StmtTestUtils.parseYangSources("/semantic-version/import/import-invalid-deprecated-1",
-                    StatementParserMode.SEMVER_MODE);
-            fail("Test should fail due to invalid import of semantic-version module");
+            StmtTestUtils.parseYangSources("/openconfig-version/import/import-invalid-deprecated-1",
+                    StatementParserMode.OPENCONFIG_VER_MODE);
+            fail("Test should fail due to invalid import of openconfig-version module");
         } catch (ReactorException e) {
             assertTrue(e.getCause().getMessage().startsWith(
-                    "Unable to find module compatible with requested import " + "[semantic-version(1.0.0)]."));
+                    "Unable to find module compatible with requested import " + "[openconfig-extensions(1.0.0)]."));
         }
     }
 
     @Test
     public void importInvalidDeprecatedTest2() throws Exception {
         try {
-            StmtTestUtils.parseYangSources("/semantic-version/import/import-invalid-deprecated-2",
-                    StatementParserMode.SEMVER_MODE);
-            fail("Test should fail due to invalid import of semantic-version module");
+            StmtTestUtils.parseYangSources("/openconfig-version/import/import-invalid-deprecated-2",
+                    StatementParserMode.OPENCONFIG_VER_MODE);
+            fail("Test should fail due to invalid import of openconfig-version module");
         } catch (ReactorException e) {
             assertTrue(e.getCause().getMessage().startsWith(
-                    "Unable to find module compatible with requested import " + "[semantic-version(0.9.9)]."));
+                    "Unable to find module compatible with requested import " + "[openconfig-extensions(0.9.9)]."));
         }
     }
 
     @Test
     public void importInvalidNotsufficientTest1() throws Exception {
         try {
-            StmtTestUtils.parseYangSources("/semantic-version/import/import-invalid-notsufficient-1",
-                    StatementParserMode.SEMVER_MODE);
-            fail("Test should fail due to invalid import of semantic-version module");
+            StmtTestUtils.parseYangSources("/openconfig-version/import/import-invalid-notsufficient-1",
+                    StatementParserMode.OPENCONFIG_VER_MODE);
+            fail("Test should fail due to invalid import of openconfig-version module");
         } catch (ReactorException e) {
             assertTrue(e.getCause().getMessage().startsWith(
-                    "Unable to find module compatible with requested import " + "[semantic-version(2.0.0)]."));
+                    "Unable to find module compatible with requested import " + "[openconfig-extensions(2.0.0)]."));
         }
     }
 
     @Test
     public void importInvalidNotsufficientTest2() throws Exception {
         try {
-            StmtTestUtils.parseYangSources("/semantic-version/import/import-invalid-notsufficient-2",
-                    StatementParserMode.SEMVER_MODE);
-            fail("Test should fail due to invalid import of semantic-version module");
+            StmtTestUtils.parseYangSources("/openconfig-version/import/import-invalid-notsufficient-2",
+                    StatementParserMode.OPENCONFIG_VER_MODE);
+            fail("Test should fail due to invalid import of openconfig-version module");
         } catch (ReactorException e) {
             assertTrue(e.getCause().getMessage().startsWith(
-                    "Unable to find module compatible with requested import " + "[semantic-version(2.0.5)]."));
+                    "Unable to find module compatible with requested import " + "[openconfig-extensions(2.0.5)]."));
         }
     }
 }