本文整理匯總了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));
}