null, InPhyPort.class);\r
Assert.assertFalse("Wrong equals", key1.equals(key2));\r
Assert.assertFalse("Wrong hashCode", key1.hashCode() == key2.hashCode());\r
+ key2.setExperimenterId(42L);\r
+ Assert.assertFalse("Wrong hashCode", key1.hashCode() == key2.hashCode());\r
}\r
\r
/**\r
key1 = new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, null, InPort.class);\r
key1.setExperimenterId(expId2);\r
Assert.assertFalse("Wrong equal by oxmClass", key1.equals(key2));\r
+ key2 = new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, null, InPort.class);\r
+ key2.setExperimenterId(expId2);\r
+ Assert.assertTrue("Wrong equal by oxmClass", key1.equals(key2));\r
key1 = new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, OpenflowBasicClass.class, null);\r
key1.setExperimenterId(expId2);\r
Assert.assertFalse("Wrong equal by oxmField", key1.equals(key2));\r
+ key2 = new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, OpenflowBasicClass.class, null);\r
+ key2.setExperimenterId(expId2);\r
+ Assert.assertTrue("Wrong equal by oxmField", key1.equals(key2));\r
+ }\r
+\r
+ /**\r
+ * Test MatchEntrySerializerKey toString()\r
+ */\r
+ @Test\r
+ public void testToString(){\r
+ MatchEntrySerializerKey<?, ?> key1;\r
+ key1 = new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, OpenflowBasicClass.class, InPort.class);\r
+\r
+ Assert.assertEquals("Wrong toString()", "msgVersion: 4 objectType: org.opendaylight.yang.gen.v1.urn.opendaylight"\r
+ + ".openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries oxm_class: org.opendaylight.yang.gen.v1.urn"\r
+ + ".opendaylight.openflow.oxm.rev130731.OpenflowBasicClass oxm_field: org.opendaylight.yang.gen.v1.urn"\r
+ + ".opendaylight.openflow.oxm.rev130731.InPort experimenterID: null", key1.toString());\r
}\r
}
\ No newline at end of file