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


Java FeatureCapability类代码示例

本文整理汇总了Java中org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FeatureCapability的典型用法代码示例。如果您正苦于以下问题:Java FeatureCapability类的具体用法?Java FeatureCapability怎么用?Java FeatureCapability使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


FeatureCapability类属于org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819包,在下文中一共展示了FeatureCapability类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testNodeAdded

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FeatureCapability; //导入依赖的package包/类
@Test
public void testNodeAdded() {
    GetFeaturesOutputBuilder featuresBuilder = new GetFeaturesOutputBuilder();
    GetFeaturesOutput features = featuresBuilder.build();
    Mockito.stub(registry.getDatapathID(connectionAdapter)).toReturn(new BigInteger("1"));
    Mockito.stub(registry.getFeaturesOutput(connectionAdapter)).toReturn(features);
    Mockito.stub(connectionAdapter.getRemoteAddress()).toReturn(new InetSocketAddress(1));

    NodeUpdatedBuilder builder = new NodeUpdatedBuilder();
    String current = String.valueOf(new BigInteger("1"));
    builder.setId(new NodeId("openflow:" + current));
    InstanceIdentifier<Node> identifier = connectionHandler.identifierFromDatapathId(new BigInteger("1"));
    builder.setNodeRef(new NodeRef(identifier));

    FlowCapableNodeUpdatedBuilder builder2 = new FlowCapableNodeUpdatedBuilder();
    try {
        builder2.setIpAddress(resolveIpAddress(new InetSocketAddress(1).getAddress()));
    } catch (Exception e) {
        e.printStackTrace();
    }

    SwitchFeatures swFeatures = new SwitchFeatures() {

        @Override
        public <E extends Augmentation<SwitchFeatures>> E getAugmentation(Class<E> arg0) {
            // TODO Auto-generated method stub
            return null;
        }

        @Override
        public Class<? extends DataContainer> getImplementedInterface() {
            // TODO Auto-generated method stub
            return null;
        }

        @Override
        public Short getMaxTables() {
            // TODO Auto-generated method stub
            return null;
        }

        @Override
        public Long getMaxBuffers() {
            // TODO Auto-generated method stub
            return null;
        }

        @Override
        public List<Class<? extends FeatureCapability>> getCapabilities() {
            // TODO Auto-generated method stub
            return null;
        }
    };

    SwitchFeaturesUtil swFeaturesUtil = SwitchFeaturesUtil.getInstance();

    builder2.setSwitchFeatures(swFeaturesUtil.buildSwitchFeatures(features));
    builder.addAugmentation(FlowCapableNodeUpdated.class, builder2.build());

    Assert.assertEquals(builder.build(), connectionHandler.nodeAdded(connectionAdapter));
}
 
开发者ID:fp7-netide,项目名称:Engine,代码行数:62,代码来源:ShimSwitchConnectionHandlerImplTest.java


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