Removed license headers erroneously added to openflowJ
[controller.git] / third-party / openflowj / src / test / java / org / openflow / protocol / OFFlowRemovedTest.java
1 package org.openflow.protocol;
2
3 import java.nio.ByteBuffer;
4
5 import junit.framework.TestCase;
6
7 import org.openflow.protocol.OFFlowRemoved.OFFlowRemovedReason;
8 import org.openflow.util.OFTestCase;
9
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);
20         bb.clear();
21         msg.writeTo(bb);
22         bb.flip();
23         msg.readFrom(bb);
24         TestCase.assertEquals(OFType.FLOW_REMOVED, msg.getType());
25         TestCase.assertEquals(OFFlowRemovedReason.OFPRR_DELETE, msg.getReason());
26     }
27 }