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


Java YangParserTestUtils.parseYangStreams方法代码示例

本文整理汇总了Java中org.opendaylight.yangtools.yang.test.util.YangParserTestUtils.parseYangStreams方法的典型用法代码示例。如果您正苦于以下问题:Java YangParserTestUtils.parseYangStreams方法的具体用法?Java YangParserTestUtils.parseYangStreams怎么用?Java YangParserTestUtils.parseYangStreams使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.opendaylight.yangtools.yang.test.util.YangParserTestUtils的用法示例。


在下文中一共展示了YangParserTestUtils.parseYangStreams方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: loadYangs

import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils; //导入方法依赖的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.yangtools.yang.test.util.YangParserTestUtils; //导入方法依赖的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: createTestContext

import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils; //导入方法依赖的package包/类
public static SchemaContext createTestContext() {
    final List<InputStream> sources;

    try {
        sources = Collections.singletonList(
            Resources.asByteSource(TestModel.class.getResource(DATASTORE_TEST_YANG)).openStream());
    } catch (IOException e1) {
        throw new ExceptionInInitializerError(e1);
    }

    try {
        return YangParserTestUtils.parseYangStreams(sources);
    }  catch (ReactorException e) {
        throw new RuntimeException("Unable to build schema context from " + sources, e);
    }
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:17,代码来源:TestModel.java

示例4: setUp

import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils; //导入方法依赖的package包/类
/**
 * @throws java.lang.Exception
 */
@Before
public void setUp() throws Exception {
    final BindingBrokerTestFactory testFactory = new BindingBrokerTestFactory();
    testFactory.setExecutor(MoreExecutors.newDirectExecutorService());
    testFactory.setStartWithParsedSchema(true);
    testContext = testFactory.getTestContext();

    testContext.start();
    domMountPointService = testContext.getDomMountProviderService();
    bindingMountPointService = testContext.getBindingMountPointService();
    assertNotNull(domMountPointService);

    final InputStream moduleStream = BindingReflections.getModuleInfo(
            OpendaylightTestRpcServiceService.class)
            .getModuleSourceStream();

    assertNotNull(moduleStream);
    final List<InputStream> rpcModels = Collections.singletonList(moduleStream);
    schemaContext = YangParserTestUtils.parseYangStreams(rpcModels);
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:24,代码来源:DOMRpcServiceTestBugfix560.java

示例5: loadYangFiles

import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils; //导入方法依赖的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

示例6: createTestContext

import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils; //导入方法依赖的package包/类
public static SchemaContext createTestContext() {
    final SchemaContext schemaContext;
    final List<InputStream> streams = Collections.singletonList(getInputStream());

    try {
        schemaContext = YangParserTestUtils.parseYangStreams(streams);
    } catch (ReactorException e) {
        throw new RuntimeException("Unable to build schema context from " + streams, e);
    }
    return schemaContext;
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:12,代码来源:BenchmarkModel.java

示例7: createTestContext

import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils; //导入方法依赖的package包/类
public static SchemaContext createTestContext() {
    final List<InputStream> streams = Collections.singletonList(getInputStream());

    try {
        return YangParserTestUtils.parseYangStreams(streams);
    } catch (ReactorException e) {
        throw new RuntimeException("Unable to build schema context from " + streams, e);
    }
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:10,代码来源:TestModel.java

示例8: select

import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils; //导入方法依赖的package包/类
public static SchemaContext select(final String... schemaFiles) {
    List<InputStream> streams = new ArrayList<>(schemaFiles.length);

    for (String schemaFile : schemaFiles) {
        streams.add(getInputStream(schemaFile));
    }

    try {
        return YangParserTestUtils.parseYangStreams(streams);
    } catch (ReactorException e) {
        throw new RuntimeException("Unable to build schema context from " + streams, e);
    }
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:14,代码来源:SchemaContextHelper.java

示例9: distributedShardedDOMDataTreeSchemaContext

import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils; //导入方法依赖的package包/类
public static SchemaContext distributedShardedDOMDataTreeSchemaContext() {
    final List<InputStream> streams = new ArrayList<>();
    try {
        // we need prefix-shard-configuration and odl-datastore-test models
        // for DistributedShardedDOMDataTree tests
        streams.add(getInputStream(ODL_DATASTORE_TEST_YANG));
        streams.add(new FileInputStream("src/main/yang/prefix-shard-configuration.yang"));
        return YangParserTestUtils.parseYangStreams(streams);
    } catch (FileNotFoundException | ReactorException e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:13,代码来源:SchemaContextHelper.java

示例10: createTestContext

import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils; //导入方法依赖的package包/类
public static SchemaContext createTestContext() {
    List<InputStream> inputStreams = new ArrayList<>();
    inputStreams.add(getDatastoreTestInputStream());
    inputStreams.add(getDatastoreAugInputStream());
    inputStreams.add(getDatastoreTestNotificationInputStream());

    try {
        return YangParserTestUtils.parseYangStreams(inputStreams);
    } catch (ReactorException e) {
        throw new RuntimeException("Unable to build schema context from " + inputStreams, e);
    }
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:13,代码来源:CompositeModel.java

示例11: resolveSchemaContext

import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils; //导入方法依赖的package包/类
private static SchemaContext resolveSchemaContext(final List<InputStream> streams) {
    try {
        return YangParserTestUtils.parseYangStreams(streams);
    } catch (ReactorException e) {
        throw new RuntimeException("Unable to build schema context from " + streams, e);
    }
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:8,代码来源:TestModel.java


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