Remove trailing whitespace
[openflowjava.git] / openflow-protocol-impl / src / test / java / org / opendaylight / openflowjava / protocol / impl / deserialization / factories / FeaturesReplyMessageFactoryTest.java
index c12a4ec6b41a7affab345506e5d96690a1d1a7db..ad4ccc596979047ae0df7d46e4fcf039735ae7bd 100644 (file)
@@ -18,7 +18,7 @@ import org.opendaylight.openflowjava.protocol.api.extensibility.MessageCodeKey;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
 import org.opendaylight.openflowjava.protocol.impl.deserialization.DeserializerRegistryImpl;
 import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
-import org.opendaylight.openflowjava.protocol.impl.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.Capabilities;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutput;
 
@@ -47,7 +47,7 @@ public class FeaturesReplyMessageFactoryTest {
     @Test
     public void test() {
         ByteBuf bb = BufferHelper.buildBuffer("00 01 02 03 04 05 06 07 00 01 02 03 01 01 00 00 00"
-                + " 00 01 41 00 01 02 03");
+                + " 00 00 00 00 01 02 03");
         GetFeaturesOutput builtByFactory = BufferHelper.deserialize(featuresFactory, bb);
 
         BufferHelper.checkHeaderV13(builtByFactory);
@@ -55,7 +55,21 @@ public class FeaturesReplyMessageFactoryTest {
         Assert.assertEquals("Wrong buffers", 0x00010203L, builtByFactory.getBuffers().longValue());
         Assert.assertEquals("Wrong number of tables", 0x01, builtByFactory.getTables().shortValue());
         Assert.assertEquals("Wrong auxiliaryId", 0x01, builtByFactory.getAuxiliaryId().shortValue());
-        Assert.assertEquals("Wrong capabilities", new Capabilities(true, false, false, true, false, true, false), builtByFactory.getCapabilities());
+        Assert.assertEquals("Wrong capabilities", new Capabilities(false, false, false, false, false, false, false), builtByFactory.getCapabilities());
         Assert.assertEquals("Wrong reserved", 0x00010203L, builtByFactory.getReserved().longValue());
     }
-}
+
+    /**
+     * Testing {@link FeaturesReplyMessageFactory} for correct translation into POJO
+     * (capabilities set)
+     */
+    @Test
+    public void testCapabilities() {
+        ByteBuf bb = BufferHelper.buildBuffer("00 01 02 03 04 05 06 07 00 01 02 03 01 01 00 00 00"
+                + " 00 01 6F 00 01 02 03");
+        GetFeaturesOutput builtByFactory = BufferHelper.deserialize(featuresFactory, bb);
+
+        BufferHelper.checkHeaderV13(builtByFactory);
+        Assert.assertEquals("Wrong capabilities", new Capabilities(true, true, true, true, true, true, true), builtByFactory.getCapabilities());
+    }
+}
\ No newline at end of file