Initial opendaylight infrastructure commit!!
[controller.git] / third-party / openflowj / src / test / java / org / openflow / protocol / OFTypeTest.java
1
2 /*
3  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
4  *
5  * This program and the accompanying materials are made available under the
6  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
7  * and is available at http://www.eclipse.org/legal/epl-v10.html
8  */
9
10 package org.openflow.protocol;
11
12
13 import junit.framework.TestCase;
14
15 import org.junit.Test;
16
17
18 public class OFTypeTest extends TestCase {
19
20     public void testOFTypeCreate() throws Exception {
21         OFType foo = OFType.HELLO;
22         Class<? extends OFMessage> c = foo.toClass();
23         TestCase.assertEquals(c, OFHello.class);
24     }
25
26     @Test
27     public void testMapping() throws Exception {
28         TestCase.assertEquals(OFType.HELLO, OFType.valueOf((byte) 0));
29         TestCase.assertEquals(OFType.BARRIER_REPLY, OFType.valueOf((byte) 19));
30     }
31 }