import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-import java.io.FileNotFoundException;
import java.net.URI;
-import java.net.URISyntaxException;
import org.junit.Test;
import org.opendaylight.yangtools.concepts.SemVer;
import org.opendaylight.yangtools.yang.model.api.Module;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
import org.opendaylight.yangtools.yang.model.repo.api.StatementParserMode;
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 SemanticVersionDefaultsTest {
@Test
- public void defaultsTest() throws SourceException, FileNotFoundException, ReactorException, URISyntaxException {
+ public void defaultsTest() throws Exception {
SchemaContext context = StmtTestUtils.parseYangSources("/semantic-version/defaults/defaults",
StatementParserMode.SEMVER_MODE);
assertNotNull(context);
}
@Test
- public void defaultMajorValidTest() throws SourceException, FileNotFoundException, ReactorException,
- URISyntaxException {
+ public void defaultMajorValidTest() throws Exception {
SchemaContext context = StmtTestUtils.parseYangSources("/semantic-version/defaults/default-major-valid",
StatementParserMode.SEMVER_MODE);
assertNotNull(context);
}
@Test
- public void defaultMajorInvalidTest() throws SourceException, FileNotFoundException, ReactorException,
- URISyntaxException {
+ public void defaultMajorInvalidTest() throws Exception {
try {
- StmtTestUtils.parseYangSources("/semantic-version/defaults/default-major-invalid", StatementParserMode.SEMVER_MODE);
+ StmtTestUtils.parseYangSources("/semantic-version/defaults/default-major-invalid",
+ StatementParserMode.SEMVER_MODE);
fail("Test should fail due to invalid semantic version");
} catch (ReactorException e) {
assertTrue(e.getCause().getMessage()