import static org.junit.Assert.assertTrue;
import com.google.common.collect.ImmutableList;
-import java.io.FileNotFoundException;
-import java.net.URISyntaxException;
import org.junit.Test;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode;
import org.opendaylight.yangtools.yang.model.api.SchemaNode;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
import org.opendaylight.yangtools.yang.model.util.SchemaContextUtil;
-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 Bug6884Test {
private static final String FOO_REV = "1970-01-01";
@Test
- public void testYang11() throws SourceException, FileNotFoundException, ReactorException, URISyntaxException {
+ public void testYang11() throws Exception {
final SchemaContext schemaContext = StmtTestUtils.parseYangSources("/rfc7950/bug6884/yang1-1");
assertNotNull(schemaContext);
- assertTrue(findNode(schemaContext, ImmutableList.of(foo("sub-root"), foo("sub-foo-2-con"))) instanceof ContainerSchemaNode);
+ assertTrue(findNode(schemaContext, ImmutableList.of(foo("sub-root"), foo("sub-foo-2-con")))
+ instanceof ContainerSchemaNode);
}
@Test
- public void testCircularIncludesYang10() throws SourceException, FileNotFoundException, ReactorException,
- URISyntaxException {
+ public void testCircularIncludesYang10() throws Exception {
final SchemaContext schemaContext = StmtTestUtils.parseYangSources("/rfc7950/bug6884/circular-includes");
assertNotNull(schemaContext);
- assertTrue(findNode(schemaContext, ImmutableList.of(foo("sub-root"), foo("sub-foo-2-con"))) instanceof ContainerSchemaNode);
- assertTrue(findNode(schemaContext, ImmutableList.of(foo("sub-root-2"), foo("sub-foo-con"))) instanceof ContainerSchemaNode);
+ assertTrue(findNode(schemaContext, ImmutableList.of(foo("sub-root"), foo("sub-foo-2-con")))
+ instanceof ContainerSchemaNode);
+ assertTrue(findNode(schemaContext, ImmutableList.of(foo("sub-root-2"), foo("sub-foo-con")))
+ instanceof ContainerSchemaNode);
}
private static SchemaNode findNode(final SchemaContext context, final Iterable<QName> qNames) {