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