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