Remove deprecated Yin/YangStatementSourceImpl
[yangtools.git] / yang / yang-parser-impl / src / test / java / org / opendaylight / yangtools / yang / stmt / yin / YinFileIdentityStmtTest.java
index 4d956a5bdc2eb0fc57ee8b69e675c58ec435c945..0c62ab50b3214794bc37d1f4e58b0507492df542 100644 (file)
@@ -14,6 +14,7 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertThat;
 
+import java.io.IOException;
 import java.net.URISyntaxException;
 import java.util.Iterator;
 import java.util.Set;
@@ -21,22 +22,24 @@ import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.yangtools.yang.model.api.IdentitySchemaNode;
 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 YinFileIdentityStmtTest {
 
-    private Set<Module> modules;
+    private SchemaContext context;
 
     @Before
-    public void init() throws URISyntaxException, ReactorException {
-        modules = TestUtils.loadYinModules(getClass().getResource("/semantic-statement-parser/yin/modules").toURI());
-        assertEquals(9, modules.size());
+    public void init() throws URISyntaxException, ReactorException, SAXException, IOException {
+        context = TestUtils.loadYinModules(getClass().getResource("/semantic-statement-parser/yin/modules").toURI());
+        assertEquals(9, context.getModules().size());
     }
 
     @Test
     public void testIdentity() throws URISyntaxException {
-        Module testModule = TestUtils.findModule(modules, "config");
+        Module testModule = TestUtils.findModule(context, "config").get();
         assertNotNull(testModule);
 
         Set<IdentitySchemaNode> identities = testModule.getIdentities();
@@ -51,6 +54,5 @@ public class YinFileIdentityStmtTest {
         id = idIterator.next();
         assertThat(id.getQName().getLocalName(), anyOf(is("module-type"), is("service-type")));
         assertNull(id.getBaseIdentity());
-
     }
 }