import static org.junit.Assert.assertNotNull;
-import java.io.File;
-import java.io.FileNotFoundException;
import java.net.URI;
-import java.net.URISyntaxException;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
-import org.opendaylight.mdsal.binding.yang.types.TypeProviderImpl;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
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.api.TypeDefinition;
-import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
public class Bug4621 {
public ExpectedException expectedEx = ExpectedException.none();
@Test
- public void bug4621test() throws FileNotFoundException, ReactorException, URISyntaxException {
- File file = new File(getClass().getResource("/bug-4621/foo.yang").toURI());
-
- final SchemaContext schemaContext = YangParserTestUtils.parseYangSources(file);
- final Module moduleValid = schemaContext.findModuleByNamespace(new URI("foo")).iterator().next();
+ public void bug4621test() {
+ final SchemaContext schemaContext = YangParserTestUtils.parseYangResource("/bug-4621/foo.yang");
+ final Module moduleValid = schemaContext.findModules(URI.create("foo")).iterator().next();
final TypeProviderImpl typeProvider = new TypeProviderImpl(schemaContext);
expectedEx.expect(IllegalArgumentException.class);