Added key unit tests
[openflowjava.git] / openflow-protocol-api / src / test / java / org / opendaylight / openflowjava / protocol / api / keys / ActionSerializerKeyTest.java
index 5dbd02cb768e95d118dc8bd051b3c4049f33a55e..e145e8a23e01ba0044f7bbfb12b0f87ee791a575 100644 (file)
@@ -47,4 +47,20 @@ public class ActionSerializerKeyTest {
         Assert.assertFalse("Wrong equals", key1.equals(key2));\r
         Assert.assertFalse("Wrong hashCode", key1.hashCode() == key2.hashCode());\r
     }\r
+    \r
+    /**\r
+     * Test ActionDeserializerKey equals - additional test\r
+     */\r
+    @Test\r
+    public void testEquals(){\r
+         ActionSerializerKey<CopyTtlIn> key1 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, null, 42L);\r
+         ActionSerializerKey<?> key2 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, CopyTtlIn.class, 42L);\r
+         \r
+         Assert.assertTrue("Wrong equal to identical object.", key1.equals(key1));\r
+         \r
+         Assert.assertFalse("Wrong equal by actionType", key1.equals(key2));\r
+         \r
+         key1 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID,  CopyTtlIn.class, null);\r
+         Assert.assertFalse("Wrong equal by experimenterId", key1.equals(key2));\r
+    }\r
 }
\ No newline at end of file