Merge "Updated registration of Binding Aware notification listeners."
[controller.git] / third-party / openflowj / src / test / java / org / openflow / util / HexStringTest.java
1 package org.openflow.util;
2
3 import junit.framework.TestCase;
4
5 /**
6  * Does hexstring conversion work?
7  * 
8  * @author Rob Sherwood (rob.sherwood@stanford.edu)
9  * 
10  */
11
12 public class HexStringTest extends TestCase {
13
14     public void testMarshalling() throws Exception {
15         String dpidStr = "00:00:00:23:20:2d:16:71";
16         long dpid = HexString.toLong(dpidStr);
17         String testStr = HexString.toHexString(dpid);
18         TestCase.assertEquals(dpidStr, testStr);
19     }
20
21     public void testToStringBytes() {
22         byte[] dpid = { 0, 0, 0, 0, 0, 0, 0, -1 };
23         String valid = "00:00:00:00:00:00:00:ff";
24         String testString = HexString.toHexString(dpid);
25         TestCase.assertEquals(valid, testString);
26     }
27 }