Added more (de)serialization factories + ByteBufUtils methods
[openflowjava.git] / openflow-protocol-impl / src / test / java / org / opendaylight / openflowjava / protocol / impl / deserialization / factories / PortStatusMessageFactoryTest.java
diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/PortStatusMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/PortStatusMessageFactoryTest.java
new file mode 100644 (file)
index 0000000..2100a5a
--- /dev/null
@@ -0,0 +1,29 @@
+/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */\r
+\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.factories;\r
+\r
+import io.netty.buffer.ByteBuf;\r
+\r
+import org.junit.Test;\r
+import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortStatusMessage;\r
+\r
+/**\r
+ * @author timotej.kubas\r
+ * @author michal.polkorab\r
+ */\r
+public class PortStatusMessageFactoryTest {\r
+\r
+    /**\r
+     * Testing {@link PortStatusMessageFactory} for correct translation into POJO\r
+     */\r
+    @Test\r
+    public void test(){\r
+        ByteBuf bb = BufferHelper.buildBuffer("01 00 00 00 00 00 00 00");\r
+        \r
+        PortStatusMessage builtByFactory = BufferHelper.decodeV13(PortStatusMessageFactory.getInstance(), bb);\r
+        \r
+        BufferHelper.checkHeaderV13(builtByFactory);\r
+        //Assert.assertEquals("Wrong reason", 0x01, builtByFactory.getReason());\r
+    }\r
+}\r