X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflowjava%2Fopenflow-protocol-api%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fopenflowjava%2Fprotocol%2Fapi%2Fkeys%2FKeysTest.java;h=350a91a5bc7ff27e321d8fb9571e8ae8d7bd6ae4;hb=7fd2240386d8ef5b04d897342f73122674cd6f35;hp=d2aefedbf5dd335709be3a13bf5df1a9a72e0449;hpb=8e54802677177ddcb7cacc1324862b7e46a38910;p=openflowplugin.git diff --git a/openflowjava/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/KeysTest.java b/openflowjava/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/KeysTest.java index d2aefedbf5..350a91a5bc 100644 --- a/openflowjava/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/KeysTest.java +++ b/openflowjava/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/KeysTest.java @@ -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 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 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 }