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