當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。