* 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.parser.spi.meta.ReactorException;
import org.opendaylight.yangtools.yang.stmt.StmtTestUtils;
-public class OpenconfigVersionImportTest {
+public class SemanticVersionImportTest {
@Test
public void importValidTest() throws Exception {
- SchemaContext context = StmtTestUtils.parseYangSources("/openconfig-version/import/import-valid",
- StatementParserMode.OPENCONFIG_VER_MODE);
+ SchemaContext context = StmtTestUtils.parseYangSources("/semantic-version/import/import-valid",
+ StatementParserMode.SEMVER_MODE);
assertNotNull(context);
- 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("1.0.0"), semVer.getOpenconfigVersion());
+ assertEquals(SemVer.valueOf("1.0.0"), semVer.getSemanticVersion());
}
@Test
public void importInvalidDeprecatedTest1() throws Exception {
try {
- 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");
+ StmtTestUtils.parseYangSources("/semantic-version/import/import-invalid-deprecated-1",
+ StatementParserMode.SEMVER_MODE);
+ fail("Test should fail due to invalid import of semantic-version module");
} catch (ReactorException e) {
assertTrue(e.getCause().getMessage().startsWith(
- "Unable to find module compatible with requested import " + "[openconfig-extensions(1.0.0)]."));
+ "Unable to find module compatible with requested import " + "[semantic-version(1.0.0)]."));
}
}
@Test
public void importInvalidDeprecatedTest2() throws Exception {
try {
- 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");
+ StmtTestUtils.parseYangSources("/semantic-version/import/import-invalid-deprecated-2",
+ StatementParserMode.SEMVER_MODE);
+ fail("Test should fail due to invalid import of semantic-version module");
} catch (ReactorException e) {
assertTrue(e.getCause().getMessage().startsWith(
- "Unable to find module compatible with requested import " + "[openconfig-extensions(0.9.9)]."));
+ "Unable to find module compatible with requested import " + "[semantic-version(0.9.9)]."));
}
}
@Test
public void importInvalidNotsufficientTest1() throws Exception {
try {
- 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");
+ StmtTestUtils.parseYangSources("/semantic-version/import/import-invalid-notsufficient-1",
+ StatementParserMode.SEMVER_MODE);
+ fail("Test should fail due to invalid import of semantic-version module");
} catch (ReactorException e) {
assertTrue(e.getCause().getMessage().startsWith(
- "Unable to find module compatible with requested import " + "[openconfig-extensions(2.0.0)]."));
+ "Unable to find module compatible with requested import " + "[semantic-version(2.0.0)]."));
}
}
@Test
public void importInvalidNotsufficientTest2() throws Exception {
try {
- 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");
+ StmtTestUtils.parseYangSources("/semantic-version/import/import-invalid-notsufficient-2",
+ StatementParserMode.SEMVER_MODE);
+ fail("Test should fail due to invalid import of semantic-version module");
} catch (ReactorException e) {
assertTrue(e.getCause().getMessage().startsWith(
- "Unable to find module compatible with requested import " + "[openconfig-extensions(2.0.5)]."));
+ "Unable to find module compatible with requested import " + "[semantic-version(2.0.5)]."));
}
}
}