* 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.openconfigver;
+package org.opendaylight.yangtools.yang.stmt.semver;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import org.opendaylight.yangtools.yang.model.repo.api.StatementParserMode;
import org.opendaylight.yangtools.yang.stmt.StmtTestUtils;
-public class OpenconfigVersionIgnoringRevisionTest {
+public class SemanticVersionIgnoringRevisionTest {
@Test
public void ignoringRevisionTest() throws Exception {
- SchemaContext context = StmtTestUtils.parseYangSources("/openconfig-version/ignoring-revision",
- StatementParserMode.OPENCONFIG_VER_MODE);
+ SchemaContext context = StmtTestUtils.parseYangSources("/semantic-version/ignoring-revision",
+ StatementParserMode.SEMVER_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("http://openconfig.net/yang/openconfig-ext"))
+ Module semVer = context.findModuleByNamespace(new URI("urn:opendaylight:yang:extension:semantic-version"))
.iterator().next();
- assertEquals(SemVer.valueOf("0.0.1"), semVer.getOpenconfigVersion());
- assertEquals(SemVer.valueOf("0.1.1"), foo.getOpenconfigVersion());
- assertEquals(SemVer.valueOf("0.1.2"), bar.getOpenconfigVersion());
+ assertEquals(SemVer.valueOf("0.0.1"), semVer.getSemanticVersion());
+ assertEquals(SemVer.valueOf("0.1.1"), foo.getSemanticVersion());
+ assertEquals(SemVer.valueOf("0.1.2"), bar.getSemanticVersion());
}
@Test
public void ignoringRevision2Test() throws Exception {
- SchemaContext context = StmtTestUtils.parseYangSources("/openconfig-version/ignoring-revision-2",
- StatementParserMode.OPENCONFIG_VER_MODE);
+ SchemaContext context = StmtTestUtils.parseYangSources("/semantic-version/ignoring-revision-2",
+ StatementParserMode.SEMVER_MODE);
assertNotNull(context);
Module foo = context.findModuleByNamespace(new URI("foo")).iterator().next();
- Module semVer = context.findModuleByNamespace(new URI("http://openconfig.net/yang/openconfig-ext"))
+ Module semVer = context.findModuleByNamespace(new URI("urn:opendaylight:yang:extension:semantic-version"))
.iterator().next();
Module bar = StmtTestUtils.findImportedModule(context, foo, "bar");
- assertEquals(SemVer.valueOf("0.0.1"), semVer.getOpenconfigVersion());
- assertEquals(SemVer.valueOf("0.1.1"), foo.getOpenconfigVersion());
- assertEquals(SemVer.valueOf("0.1.2"), bar.getOpenconfigVersion());
+ assertEquals(SemVer.valueOf("0.0.1"), semVer.getSemanticVersion());
+ assertEquals(SemVer.valueOf("0.1.1"), foo.getSemanticVersion());
+ assertEquals(SemVer.valueOf("0.1.2"), bar.getSemanticVersion());
}
}