import java.io.IOException;
import java.net.URISyntaxException;
import java.text.ParseException;
-import java.util.Arrays;
import org.junit.Test;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.common.SimpleDateFormatUtil;
import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode;
import org.opendaylight.yangtools.yang.model.api.Module;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.model.parser.api.YangSyntaxErrorException;
import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
+import org.opendaylight.yangtools.yang.parser.rfc6020.repo.YangStatementStreamSource;
import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
import org.opendaylight.yangtools.yang.parser.stmt.reactor.CrossSourceStatementReactor;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.YangInferencePipeline;
public class ConstraintDefinitionsTest {
@Test
- public void testConstraintDefinitions() throws ParseException, ReactorException, URISyntaxException, IOException {
+ public void testConstraintDefinitions() throws ParseException, ReactorException, URISyntaxException, IOException,
+ YangSyntaxErrorException {
final CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
- final YangTextSchemaSource source = YangTextSchemaSource.forResource("/constraint-definitions-test/foo.yang");
-
- final SchemaContext schemaContext = reactor.buildEffective(Arrays.asList(source));
+ reactor.addSource(YangStatementStreamSource.create(
+ YangTextSchemaSource.forResource("/constraint-definitions-test/foo.yang")));
+ final SchemaContext schemaContext = reactor.buildEffective();
assertNotNull(schemaContext);
final Module testModule = schemaContext.findModuleByName("foo",