Remove deprecated Yin/YangStatementSourceImpl
[yangtools.git] / yang / yang-parser-impl / src / test / java / org / opendaylight / yangtools / yang / stmt / yin / YinFileFeatureStmtTest.java
index d8236937610a2e8f38bbb2237564ec9085553477..b3c8ce95045e012e3495dda67a03f634328ac002 100644 (file)
@@ -13,6 +13,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertThat;
 
+import java.io.IOException;
 import java.net.URISyntaxException;
 import java.util.Iterator;
 import java.util.Set;
@@ -20,23 +21,25 @@ import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.yangtools.yang.model.api.FeatureDefinition;
 import org.opendaylight.yangtools.yang.model.api.Module;
+import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
 import org.opendaylight.yangtools.yang.stmt.TestUtils;
+import org.xml.sax.SAXException;
 
 public class YinFileFeatureStmtTest {
 
-    private Set<Module> modules;
+    private SchemaContext context;
 
     @Before
-    public void init() throws URISyntaxException, ReactorException {
-        modules = TestUtils.loadYinModules(getClass().getResource
-                ("/semantic-statement-parser/yin/feature-test/").toURI());
-        assertEquals(1, modules.size());
+    public void init() throws ReactorException, SAXException, IOException, URISyntaxException {
+        context = TestUtils.loadYinModules(getClass().getResource("/semantic-statement-parser/yin/feature-test/")
+            .toURI());
+        assertEquals(1, context.getModules().size());
     }
 
     @Test
     public void testFeature() {
-        Module testModule = TestUtils.findModule(modules, "yang-with-features");
+        Module testModule = TestUtils.findModule(context, "yang-with-features").get();
         assertNotNull(testModule);
 
         Set<FeatureDefinition> features = testModule.getFeatures();