Merge "Add INFO.yaml for openflowplugin"
[openflowplugin.git] / openflowjava / openflow-protocol-api / src / test / java / org / opendaylight / openflowjava / protocol / api / keys / KeysTest.java
index d2aefedbf5dd335709be3a13bf5df1a9a72e0449..350a91a5bc7ff27e321d8fb9571e8ae8d7bd6ae4 100644 (file)
@@ -15,14 +15,17 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.ExperimenterActionSubType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.InPort;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 /**
+ * Unit tests for keys.
+ *
  * @author michal.polkorab
  */
 public class KeysTest {
 
     /**
-     * Testing equals() and hashcode() methods of extension deserializer's keys
+     * Testing equals() and hashcode() methods of extension deserializer's keys.
      */
     @Test
     public void testEqualsAndHashcodeOfDeserializerKeys() {
@@ -35,7 +38,8 @@ public class KeysTest {
 
         InstructionDeserializerKey instructionDeserializerKey = new InstructionDeserializerKey(
                 EncodeConstants.OF13_VERSION_ID, EncodeConstants.EXPERIMENTER_VALUE, 1L);
-        ExperimenterInstructionDeserializerKey experimenterInstructionDeserializerKey = new ExperimenterInstructionDeserializerKey(
+        ExperimenterInstructionDeserializerKey experimenterInstructionDeserializerKey =
+                new ExperimenterInstructionDeserializerKey(
                 EncodeConstants.OF13_VERSION_ID, 1L);
         Assert.assertEquals(instructionDeserializerKey, experimenterInstructionDeserializerKey);
         Assert.assertEquals(instructionDeserializerKey.hashCode(), experimenterInstructionDeserializerKey.hashCode());
@@ -49,23 +53,24 @@ public class KeysTest {
     }
 
     /**
-     * Testing equals() and hashcode() methods of extension serializer's keys
+     * Testing equals() and hashcode() methods of extension serializer's keys.
      */
     @Test
     public void testEqualsAndHashcodeOfActionDeserializerKeys() {
         ActionSerializerKey<ExperimenterIdCase> actionSerializerKey = new ActionSerializerKey<>(
-                EncodeConstants.OF13_VERSION_ID, ExperimenterIdCase.class, 1L);
+                EncodeConstants.OF13_VERSION_ID, ExperimenterIdCase.class, Uint32.ONE);
         ExperimenterActionSerializerKey experimenterActionSerializerKey = new ExperimenterActionSerializerKey(
-                EncodeConstants.OF13_VERSION_ID, 1L, ExpSubType.class);
+                EncodeConstants.OF13_VERSION_ID,  Uint32.ONE, ExpSubType.class);
         Assert.assertFalse(actionSerializerKey.equals(experimenterActionSerializerKey));
         Assert.assertFalse(experimenterActionSerializerKey.equals(actionSerializerKey));
 
         InstructionSerializerKey<org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225
-        .instruction.container.instruction.choice.ExperimenterIdCase> instructionSerializerKey =
+            .instruction.container.instruction.choice.ExperimenterIdCase> instructionSerializerKey =
                 new InstructionSerializerKey<>(EncodeConstants.OF13_VERSION_ID, org.opendaylight.yang.gen.v1.urn
                         .opendaylight.openflow.augments.rev150225.instruction.container.instruction.choice
                         .ExperimenterIdCase.class, 1L);
-        ExperimenterInstructionSerializerKey experimenterInstructionSerializerKey = new ExperimenterInstructionSerializerKey(EncodeConstants.OF13_VERSION_ID, 1L);
+        ExperimenterInstructionSerializerKey experimenterInstructionSerializerKey =
+                new ExperimenterInstructionSerializerKey(EncodeConstants.OF13_VERSION_ID, 1L);
         Assert.assertEquals(instructionSerializerKey, experimenterInstructionSerializerKey);
         Assert.assertEquals(instructionSerializerKey.hashCode(), experimenterInstructionSerializerKey.hashCode());
 
@@ -77,7 +82,7 @@ public class KeysTest {
         Assert.assertEquals(matchKey.hashCode(), matchKey2.hashCode());
     }
 
-    private static class ExpSubType extends ExperimenterActionSubType {
+    private interface ExpSubType extends ExperimenterActionSubType {
         // empty class - only used in test for comparation
     }