461f2ca241ff6c7548dae8f593906055d10683a4
[openflowjava.git] / third-party / openflow-codec / src / test / java / org / openflow / codec / protocol / OFPGetConfigReplyTest.java
1 package org.openflow.codec.protocol;
2
3 import junit.framework.TestCase;
4
5 import org.openflow.codec.io.DataBuffers;
6 import org.openflow.codec.io.IDataBuffer;
7 import org.openflow.codec.protocol.OFPSetConfig;
8 import org.openflow.codec.protocol.OFPType;
9 import org.openflow.codec.util.OFTestCase;
10
11 public class OFPGetConfigReplyTest extends OFTestCase {
12     public void testWriteRead() throws Exception {
13         OFPSetConfig msg = (OFPSetConfig) messageFactory.getMessage(OFPType.SET_CONFIG);
14         msg.setFlags((short) 1);
15         IDataBuffer bb = DataBuffers.allocate(1024);
16         bb.clear();
17         msg.writeTo(bb);
18         bb.flip();
19         msg.readFrom(bb);
20         TestCase.assertEquals(OFPType.SET_CONFIG, msg.getType());
21         TestCase.assertEquals((short) 1, msg.getFlags());
22     }
23 }