Fixed ByteBuf logging
[openflowjava.git] / openflow-protocol-impl / src / test / java / org / opendaylight / openflowjava / protocol / impl / util / ByteBufUtilsTest.java
index 8f94d42c593843f3dd735930f381a75406ee9b50..c7a5ee97987b26a66346779737595f246f9664f0 100644 (file)
@@ -241,4 +241,14 @@ public class ByteBufUtilsTest {
         Assert.assertEquals("Wrong string decoded", "SPIDERMAN", ByteBufUtils.decodeNullTerminatedString(buf2, 15));
     }
 
+    /**
+     * Test of {@link ByteBufUtils#byteBufToHexString(ByteBuf)}
+     */
+    @Test
+    public void testByteBufToHexString() {
+        ByteBuf buf = ByteBufUtils.hexStringToByteBuf("00 01 02 03 04 05 06 07");
+        buf.skipBytes(4);
+        Assert.assertEquals("Wrong data read", "04 05 06 07", ByteBufUtils.byteBufToHexString(buf));
+    }
+
 }