- final YangContextParser parser = new YangParserImpl();
- final InputStream moduleStream = BindingReflections.getModuleInfo(
- OpendaylightTestRpcServiceService.class)
- .getModuleSourceStream();
-
- assertNotNull(moduleStream);
- List<InputStream> rpcModels = Collections.singletonList(moduleStream);
- @SuppressWarnings("deprecation")
- Set<Module> modules = parser.parseYangModelsFromStreams(rpcModels);
- @SuppressWarnings("deprecation")
- SchemaContext mountSchemaContext = parser.resolveSchemaContext(modules);
- schemaContext = mountSchemaContext;
+ final YangModuleInfo moduleInfo = BindingReflections.getModuleInfo(OpendaylightTestRpcServiceService.class);
+ assertNotNull(moduleInfo);
+
+ schemaContext = YangParserTestUtils.parseYangSources(StatementParserMode.DEFAULT_MODE, null,
+ YangTextSchemaSource.delegateForByteSource(RevisionSourceIdentifier.create(
+ moduleInfo.getName().getLocalName(), moduleInfo.getName().getRevision()),
+ moduleInfo.getYangTextByteSource()));