--- /dev/null
+/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.factories;\r
+\r
+import io.netty.buffer.ByteBuf;\r
+\r
+import org.junit.Assert;\r
+import org.junit.Test;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.factories.HelloMessageFactory;\r
+import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloMessage;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ *\r
+ */\r
+public class HelloMessageFactoryTest {\r
+ \r
+ /** Number of currently supported version / codec */\r
+ public static final short VERSION_YET_SUPPORTED = 0x04;\r
+ /** Index of Xid in OpenFlow 1.3 header */\r
+ public static final byte INDEX_OF_XID_IN_HEADER = 4;\r
+\r
+ /**\r
+ * Testing {@link HelloMessageFactory} for correct translation into POJO\r
+ */\r
+ @Test\r
+ public void test() {\r
+ ByteBuf bb = BufferHelper.buildBuffer(new byte[0]);\r
+ HelloMessage builtByFactory = HelloMessageFactory.getInstance().bufferToMessage(bb, VERSION_YET_SUPPORTED);\r
+\r
+ Assert.assertTrue(builtByFactory.getVersion() == VERSION_YET_SUPPORTED);\r
+ Assert.assertEquals(builtByFactory.getXid().longValue(), 16909060L);\r
+ }\r
+}\r