Bug 4640: Change semantic-version to openconfig-version
[yangtools.git] / yang / yang-parser-impl / src / test / java / org / opendaylight / yangtools / yang / stmt / openconfigver / yin / YinOpenconfigVersionTest.java
@@ -6,7 +6,7 @@
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 
-package org.opendaylight.yangtools.yang.stmt.semver.yin;
+package org.opendaylight.yangtools.yang.stmt.openconfigver.yin;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
@@ -25,46 +25,46 @@ import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
 import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
 import org.opendaylight.yangtools.yang.stmt.StmtTestUtils;
 
-public class YinSemanticVersionTest {
+public class YinOpenconfigVersionTest {
 
     @Test
     public void basicTest() throws SourceException, FileNotFoundException, ReactorException, URISyntaxException {
-        SchemaContext context = StmtTestUtils.parseYinSources("/semantic-version/yin-input/basic",
-                StatementParserMode.SEMVER_MODE);
+        SchemaContext context = StmtTestUtils.parseYinSources("/openconfig-version/yin-input/basic",
+                StatementParserMode.OPENCONFIG_VER_MODE);
         assertNotNull(context);
 
         Module foo = context.findModuleByNamespace(new URI("foo")).iterator().next();
         Module bar = context.findModuleByNamespace(new URI("bar")).iterator().next();
-        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("0.0.1"), semVer.getSemanticVersion());
-        assertEquals(SemVer.valueOf("0.1.1"), foo.getSemanticVersion());
-        assertEquals(SemVer.valueOf("0.1.2"), bar.getSemanticVersion());
+        assertEquals(SemVer.valueOf("0.0.1"), semVer.getOpenconfigVersion());
+        assertEquals(SemVer.valueOf("0.1.1"), foo.getOpenconfigVersion());
+        assertEquals(SemVer.valueOf("0.1.2"), bar.getOpenconfigVersion());
     }
 
     @Test
     public void basicImportTest1() throws SourceException, FileNotFoundException, ReactorException, URISyntaxException {
-        SchemaContext context = StmtTestUtils.parseYinSources("/semantic-version/yin-input/basic-import",
-                StatementParserMode.SEMVER_MODE);
+        SchemaContext context = StmtTestUtils.parseYinSources("/openconfig-version/yin-input/basic-import",
+                StatementParserMode.OPENCONFIG_VER_MODE);
         assertNotNull(context);
 
         Module foo = context.findModuleByNamespace(new URI("foo")).iterator().next();
-        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("0.0.1"), semVer.getSemanticVersion());
-        assertEquals(SemVer.valueOf("0.1.1"), foo.getSemanticVersion());
+        assertEquals(SemVer.valueOf("0.0.1"), semVer.getOpenconfigVersion());
+        assertEquals(SemVer.valueOf("0.1.1"), foo.getOpenconfigVersion());
         Module bar = StmtTestUtils.findImportedModule(context, foo, "bar");
-        assertEquals(SemVer.valueOf("0.1.2"), bar.getSemanticVersion());
+        assertEquals(SemVer.valueOf("0.1.2"), bar.getOpenconfigVersion());
     }
 
     @Test
     public void basicImportErrTest1() throws SourceException, FileNotFoundException, ReactorException,
             URISyntaxException {
         try {
-            StmtTestUtils.parseYinSources("/semantic-version/yin-input/basic-import-invalid", StatementParserMode.SEMVER_MODE);
-            fail("Test should fail due to invalid semantic version");
+            StmtTestUtils.parseYinSources("/openconfig-version/yin-input/basic-import-invalid", StatementParserMode.OPENCONFIG_VER_MODE);
+            fail("Test should fail due to invalid openconfig version");
         } catch (ReactorException e) {
             assertTrue(e.getCause().getMessage()
                     .startsWith("Unable to find module compatible with requested import [bar(0.1.2)]."));