1 package org.openflow.protocol;
3 import java.nio.ByteBuffer;
5 import junit.framework.TestCase;
7 import org.openflow.protocol.OFFlowRemoved.OFFlowRemovedReason;
8 import org.openflow.util.OFTestCase;
10 public class OFFlowRemovedTest extends OFTestCase {
11 public void testWriteRead() throws Exception {
12 OFFlowRemoved msg = (OFFlowRemoved) messageFactory
13 .getMessage(OFType.FLOW_REMOVED);
14 msg.setMatch(new OFMatch());
15 byte[] hwAddr = new byte[6];
16 msg.getMatch().setDataLayerDestination(hwAddr);
17 msg.getMatch().setDataLayerSource(hwAddr);
18 msg.setReason(OFFlowRemovedReason.OFPRR_DELETE);
19 ByteBuffer bb = ByteBuffer.allocate(1024);
24 TestCase.assertEquals(OFType.FLOW_REMOVED, msg.getType());
25 TestCase.assertEquals(OFFlowRemovedReason.OFPRR_DELETE, msg.getReason());