Remove deprecated Yin/YangStatementSourceImpl
[yangtools.git] / yang / yang-parser-impl / src / test / java / org / opendaylight / yangtools / yang / stmt / yin / YinFileRpcStmtTest.java
index c00cb6a4c95657934b036907e4b2970769196bae..45f111a2c6824d31a3a263f983304c5eb56df8fb 100644 (file)
@@ -10,6 +10,7 @@ package org.opendaylight.yangtools.yang.stmt.yin;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
+import java.io.IOException;
 import java.net.URISyntaxException;
 import java.util.Set;
 import org.junit.Before;
@@ -17,24 +18,24 @@ import org.junit.Test;
 import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode;
 import org.opendaylight.yangtools.yang.model.api.Module;
 import org.opendaylight.yangtools.yang.model.api.RpcDefinition;
+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 YinFileRpcStmtTest {
 
-    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 testRpc() {
-        Module testModule = TestUtils.findModule(modules, "ietf-netconf-monitoring");
-        assertNotNull(testModule);
+        Module testModule = TestUtils.findModule(context, "ietf-netconf-monitoring").get();
 
         Set<RpcDefinition> rpcs = testModule.getRpcs();
         assertEquals(1, rpcs.size());