当前位置: 首页>>代码示例>>Java>>正文


Java YangModelSearchUtils类代码示例

本文整理汇总了Java中org.opendaylight.controller.config.yangjmxgenerator.plugin.util.YangModelSearchUtils的典型用法代码示例。如果您正苦于以下问题:Java YangModelSearchUtils类的具体用法?Java YangModelSearchUtils怎么用?Java YangModelSearchUtils使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


YangModelSearchUtils类属于org.opendaylight.controller.config.yangjmxgenerator.plugin.util包,在下文中一共展示了YangModelSearchUtils类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: loadYangs

import org.opendaylight.controller.config.yangjmxgenerator.plugin.util.YangModelSearchUtils; //导入依赖的package包/类
private Module loadYangs(final File testedModule, final String moduleName)
        throws Exception {
    final List<InputStream> yangISs = new ArrayList<>();
    yangISs.addAll(getStreams("/ietf-inet-types.yang"));

    yangISs.add(new FileInputStream(testedModule));

    yangISs.addAll(getConfigApiYangInputStreams());

    this.context =  YangParserTestUtils.parseYangStreams(yangISs);
    // close ISs
    for (final InputStream is : yangISs) {
        is.close();
    }
    this.namesToModules = YangModelSearchUtils.mapModulesByNames(this.context
            .getModules());
    this.configModule = this.namesToModules.get(ConfigConstants.CONFIG_MODULE);
    final Module module = this.namesToModules.get(moduleName);
    Preconditions.checkNotNull(module, "Cannot get module %s from %s",
            moduleName, this.namesToModules.keySet());
    return module;
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:23,代码来源:ModuleMXBeanEntryNameConflictTest.java

示例2: testStopOnUnknownLanguageExtension

import org.opendaylight.controller.config.yangjmxgenerator.plugin.util.YangModelSearchUtils; //导入依赖的package包/类
@Test
public void testStopOnUnknownLanguageExtension() throws Exception {
    List<InputStream> yangISs = Lists.newArrayList(getClass()
            .getResourceAsStream("test-ifcWithUnknownExtension.yang"));
    yangISs.addAll(getConfigApiYangInputStreams());
    try {
        context = YangParserTestUtils.parseYangStreams(yangISs);
        namesToModules = YangModelSearchUtils.mapModulesByNames(context.getModules());
        configModule = namesToModules.get(ConfigConstants.CONFIG_MODULE);
        threadsModule = namesToModules.get(ConfigConstants.CONFIG_THREADS_MODULE);
        try {
            super.testCreateFromIdentities();
            fail();
        } catch (IllegalStateException e) {
            assertTrue(e.getMessage(),
                    e.getMessage().startsWith("Unexpected unknown schema node."));
        }
    } finally {
        for (InputStream is : yangISs) {
            is.close();
        }
    }
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:24,代码来源:UnknownExtensionTest.java

示例3: loadYangFiles

import org.opendaylight.controller.config.yangjmxgenerator.plugin.util.YangModelSearchUtils; //导入依赖的package包/类
@Before
public void loadYangFiles() throws Exception {
    final List<InputStream> yangISs = new ArrayList<>();
    yangISs.addAll(getStreams("/test-config-threads.yang",
            "/test-config-threads-java.yang",
            "/config-bgp-listener-impl.yang", "/ietf-inet-types.yang",
            "/config-jmx-it.yang", "/config-jmx-it-impl.yang",
            "/test-config-files.yang", "/test-config-files1.yang"));

    yangISs.addAll(getConfigApiYangInputStreams());

    this.context = YangParserTestUtils.parseYangStreams(yangISs);
    // close ISs
    for (final InputStream is : yangISs) {
        is.close();
    }
    this.namesToModules = YangModelSearchUtils.mapModulesByNames(this.context
            .getModules());
    this.configModule = this.namesToModules.get(ConfigConstants.CONFIG_MODULE);
    this.rpcContextModule = this.namesToModules.get(ConfigConstants.CONFIG_MODULE);
    this.threadsModule = this.namesToModules
            .get(ConfigConstants.CONFIG_THREADS_MODULE);
    this.threadsJavaModule = this.namesToModules.get("config-threads-java");
    this.bgpListenerJavaModule = this.namesToModules.get("config-bgp-listener-impl");
    this.ietfInetTypesModule = this.namesToModules
            .get(ConfigConstants.IETF_INET_TYPES);
    this.jmxModule = this.namesToModules.get("config-jmx-it");
    this.jmxImplModule = this.namesToModules.get("config-jmx-it-impl");
    this.testFilesModule = this.namesToModules.get("test-config-files");
    this.testFiles1Module = this.namesToModules.get("test-config-files1");

}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:33,代码来源:AbstractYangTest.java


注:本文中的org.opendaylight.controller.config.yangjmxgenerator.plugin.util.YangModelSearchUtils类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。