Merge "Updated registration of Binding Aware notification listeners."
[controller.git] / third-party / openflowj / src / test / java / org / openflow / protocol / OFPortConfigTest.java
1 package org.openflow.protocol;
2
3 import java.nio.ByteBuffer;
4
5 import junit.framework.TestCase;
6
7 import org.openflow.util.OFTestCase;
8
9 public class OFPortConfigTest extends OFTestCase {
10     public void testWriteRead() throws Exception {
11         OFPortMod msg = (OFPortMod) messageFactory
12                 .getMessage(OFType.PORT_MOD);
13         msg.setHardwareAddress(new byte[6]);
14         msg.portNumber = 1;
15         ByteBuffer bb = ByteBuffer.allocate(1024);
16         bb.clear();
17         msg.writeTo(bb);
18         bb.flip();
19         msg.readFrom(bb);
20         TestCase.assertEquals(OFType.PORT_MOD, msg.getType());
21         TestCase.assertEquals(1, msg.getPortNumber());
22     }
23 }