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


Java OFFlowRemovedReason类代码示例

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


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

示例1: testWriteRead

import org.openflow.protocol.OFFlowRemoved.OFFlowRemovedReason; //导入依赖的package包/类
public void testWriteRead() throws Exception {
    OFFlowRemoved msg = (OFFlowRemoved) messageFactory
            .getMessage(OFType.FLOW_REMOVED);
    msg.setMatch(new OFMatch());
    byte[] hwAddr = new byte[6];
    msg.getMatch().setDataLayerDestination(hwAddr);
    msg.getMatch().setDataLayerSource(hwAddr);
    msg.setReason(OFFlowRemovedReason.OFPRR_DELETE);
    ByteBuffer bb = ByteBuffer.allocate(1024);
    bb.clear();
    msg.writeTo(bb);
    bb.flip();
    msg.readFrom(bb);
    TestCase.assertEquals(OFType.FLOW_REMOVED, msg.getType());
    TestCase.assertEquals(OFFlowRemovedReason.OFPRR_DELETE, msg.getReason());
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:17,代码来源:OFFlowRemovedTest.java

示例2: testWriteRead

import org.openflow.protocol.OFFlowRemoved.OFFlowRemovedReason; //导入依赖的package包/类
public void testWriteRead() throws Exception {
    OFFlowRemoved msg = (OFFlowRemoved) messageFactory
            .getMessage(OFType.FLOW_REMOVED);
    msg.setMatch(new OFMatch());
    byte[] hwAddr = new byte[6];
    msg.getMatch().setDataLayerDestination(hwAddr);
    msg.getMatch().setDataLayerSource(hwAddr);
    msg.setReason(OFFlowRemovedReason.OFPRR_DELETE);
    ChannelBuffer bb = ChannelBuffers.dynamicBuffer();
    bb.clear();
    msg.writeTo(bb);
    msg.readFrom(bb);
    TestCase.assertEquals(OFType.FLOW_REMOVED, msg.getType());
    TestCase.assertEquals(OFFlowRemovedReason.OFPRR_DELETE, msg.getReason());
}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:16,代码来源:OFFlowRemovedTest.java


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