1 package org.openflow.codec.protocol;
3 import junit.framework.TestCase;
6 import org.openflow.codec.protocol.OFPHello;
7 import org.openflow.codec.protocol.OFPMessage;
8 import org.openflow.codec.protocol.OFPType;
10 public class OFPTypeTest extends TestCase {
12 public void testOFTypeCreate() throws Exception {
13 OFPType foo = OFPType.HELLO;
14 Class<? extends OFPMessage> c = foo.toClass();
15 TestCase.assertEquals(c, OFPHello.class);
19 public void testMapping() throws Exception {
20 TestCase.assertEquals(OFPType.HELLO, OFPType.valueOf((byte) 0));
21 TestCase.assertEquals(OFPType.BARRIER_REPLY, OFPType.valueOf((byte) 21));