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() {
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());
}
/**
- * 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());
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
}