本文整理汇总了Java中org.opendaylight.yangtools.yang.model.api.Module.getFeatures方法的典型用法代码示例。如果您正苦于以下问题:Java Module.getFeatures方法的具体用法?Java Module.getFeatures怎么用?Java Module.getFeatures使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.opendaylight.yangtools.yang.model.api.Module
的用法示例。
在下文中一共展示了Module.getFeatures方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: emitBodyNodes
import org.opendaylight.yangtools.yang.model.api.Module; //导入方法依赖的package包/类
private void emitBodyNodes(final Module input) {
for (final ExtensionDefinition extension : input.getExtensionSchemaNodes()) {
emitExtension(extension);
}
for (final FeatureDefinition definition : input.getFeatures()) {
emitFeature(definition);
}
for (final IdentitySchemaNode identity : input.getIdentities()) {
emitIdentity(identity);
}
for (final Deviation deviation : input.getDeviations()) {
emitDeviation(deviation);
}
emitDataNodeContainer(input);
for (final AugmentationSchemaNode augmentation : input.getAugmentations()) {
emitAugment(augmentation);
}
for (final RpcDefinition rpc : input.getRpcs()) {
emitRpc(rpc);
}
emitNotifications(input.getNotifications());
}
示例2: testFeature
import org.opendaylight.yangtools.yang.model.api.Module; //导入方法依赖的package包/类
@Test
public void testFeature() {
Module testModule = TestUtils.findModule(context, "yang-with-features").get();
assertNotNull(testModule);
Set<FeatureDefinition> features = testModule.getFeatures();
assertEquals(2, features.size());
Iterator<FeatureDefinition> featuresIterator = features.iterator();
FeatureDefinition feature = featuresIterator.next();
assertThat(feature.getQName().getLocalName(), anyOf(is("arbitrary-names"), is("pre-provisioning")));
feature = featuresIterator.next();
assertThat(feature.getQName().getLocalName(), anyOf(is("arbitrary-names"), is("pre-provisioning")));
}
示例3: includedFeaturesTest
import org.opendaylight.yangtools.yang.model.api.Module; //导入方法依赖的package包/类
@Test
public void includedFeaturesTest() {
final Module testModule = result.findModules("root-module").iterator().next();
assertNotNull(testModule);
final Set<FeatureDefinition> features = testModule.getFeatures();
assertEquals(2, features.size());
final Iterator<FeatureDefinition> featuresIterator = features.iterator();
FeatureDefinition feature = featuresIterator.next();
assertThat(feature.getQName().getLocalName(), anyOf(is("new-feature1"), is("new-feature2")));
feature = featuresIterator.next();
assertThat(feature.getQName().getLocalName(), anyOf(is("new-feature1"), is("new-feature2")));
}
示例4: effectiveBuildTest
import org.opendaylight.yangtools.yang.model.api.Module; //导入方法依赖的package包/类
@Test
public void effectiveBuildTest() throws SourceException, ReactorException {
SchemaContext result = RFC7950Reactors.defaultReactor().newBuild()
.addSources(ROOT_MODULE, IMPORTED_MODULE, SUBMODULE)
.buildEffective();
assertNotNull(result);
Module rootModule = result.findModules("root").iterator().next();
assertNotNull(rootModule);
assertEquals("root-pref", rootModule.getPrefix());
assertEquals(YangVersion.VERSION_1, rootModule.getYangVersion());
assertEquals(Optional.of("cisco"), rootModule.getOrganization());
assertEquals(Optional.of("cisco email"), rootModule.getContact());
final ContainerSchemaNode contSchemaNode = (ContainerSchemaNode) rootModule.getDataChildByName(CONT);
assertNotNull(contSchemaNode);
final Set<AugmentationSchemaNode> augmentations = rootModule.getAugmentations();
assertEquals(1, augmentations.size());
assertEquals(CONT_SCHEMA_PATH, augmentations.iterator().next().getTargetPath());
final Set<ModuleImport> imports = rootModule.getImports();
assertEquals(1, imports.size());
final ModuleImport importStmt = imports.iterator().next();
assertNotNull(importStmt);
assertEquals("imported", importStmt.getModuleName());
assertEquals(Optional.of(REVISION), importStmt.getRevision());
assertEquals("imp-pref", importStmt.getPrefix());
final Set<Module> submodules = rootModule.getSubmodules();
assertEquals(1, submodules.size());
assertEquals("submod", submodules.iterator().next().getName());
final Set<NotificationDefinition> notifications = rootModule.getNotifications();
assertEquals(1, notifications.size());
assertEquals("notif1", notifications.iterator().next().getQName().getLocalName());
final Set<RpcDefinition> rpcs = rootModule.getRpcs();
assertEquals(1, rpcs.size());
assertEquals("rpc1", rpcs.iterator().next().getQName().getLocalName());
final Set<Deviation> deviations = rootModule.getDeviations();
assertEquals(1, deviations.size());
final Deviation deviationStmt = deviations.iterator().next();
assertNotNull(deviationStmt);
final QNameModule importedModuleQName = QNameModule.create(URI.create("imported"), REVISION);
final QName importedContQName = QName.create(importedModuleQName, "cont");
final SchemaPath importedContSchemaPath = SchemaPath.create(true, importedContQName);
assertEquals(importedContSchemaPath, deviationStmt.getTargetPath());
assertEquals(DeviateKind.ADD, deviationStmt.getDeviates().iterator().next().getDeviateType());
assertEquals(Optional.of("deviate reference"), deviationStmt.getReference());
final Set<IdentitySchemaNode> identities = rootModule.getIdentities();
assertEquals(1, identities.size());
assertEquals("identity1", identities.iterator().next().getQName().getLocalName());
final Set<FeatureDefinition> features = rootModule.getFeatures();
assertEquals(1, features.size());
final FeatureDefinition featureStmt = features.iterator().next();
assertNotNull(featureStmt);
assertEquals(FEATURE1, featureStmt.getQName());
assertEquals(FEATURE1_SCHEMA_PATH, featureStmt.getPath());
assertEquals(Optional.of("feature1 description"), featureStmt.getDescription());
assertEquals(Optional.of("feature1 reference"), featureStmt.getReference());
assertEquals(Status.CURRENT, featureStmt.getStatus());
final List<ExtensionDefinition> extensionSchemaNodes = rootModule.getExtensionSchemaNodes();
assertEquals(1, extensionSchemaNodes.size());
assertEquals("ext1", extensionSchemaNodes.iterator().next().getQName().getLocalName());
}