Search in sources :

Example 6 with ExperimenterIdDeserializerKey

use of org.opendaylight.openflowjava.protocol.api.keys.ExperimenterIdDeserializerKey in project openflowplugin by opendaylight.

the class ExperimenterDeserializerKeyFactoryTest method testCreateExperimenterMessageDeserializerKey.

@Test
public void testCreateExperimenterMessageDeserializerKey() throws Exception {
    ExperimenterIdDeserializerKey createdKey;
    ExperimenterIdDeserializerKey comparationKey;
    createdKey = ExperimenterDeserializerKeyFactory.createExperimenterMessageDeserializerKey(EncodeConstants.OF10_VERSION_ID, 43L, 1L);
    comparationKey = new ExperimenterIdTypeDeserializerKey(EncodeConstants.OF10_VERSION_ID, 43L, 1L, ExperimenterDataOfChoice.class);
    Assert.assertEquals("Wrong key created", comparationKey, createdKey);
}
Also used : ExperimenterDataOfChoice(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.experimenter.core.ExperimenterDataOfChoice) ExperimenterIdTypeDeserializerKey(org.opendaylight.openflowjava.protocol.api.keys.ExperimenterIdTypeDeserializerKey) ExperimenterIdDeserializerKey(org.opendaylight.openflowjava.protocol.api.keys.ExperimenterIdDeserializerKey) Test(org.junit.Test)

Example 7 with ExperimenterIdDeserializerKey

use of org.opendaylight.openflowjava.protocol.api.keys.ExperimenterIdDeserializerKey in project openflowplugin by opendaylight.

the class ExperimenterDeserializerKeyFactoryTest method testCreateVendorMessageDeserializerKey.

@Test
public void testCreateVendorMessageDeserializerKey() throws Exception {
    ExperimenterIdDeserializerKey createdKey;
    ExperimenterIdDeserializerKey comparationKey;
    createdKey = ExperimenterDeserializerKeyFactory.createVendorMessageDeserializerKey(EncodeConstants.OF10_VERSION_ID, 43L);
    comparationKey = new ExperimenterIdDeserializerKey(EncodeConstants.OF10_VERSION_ID, 43L, ExperimenterDataOfChoice.class);
    Assert.assertEquals("Wrong key created", comparationKey, createdKey);
}
Also used : ExperimenterDataOfChoice(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.experimenter.core.ExperimenterDataOfChoice) ExperimenterIdDeserializerKey(org.opendaylight.openflowjava.protocol.api.keys.ExperimenterIdDeserializerKey) Test(org.junit.Test)

Example 8 with ExperimenterIdDeserializerKey

use of org.opendaylight.openflowjava.protocol.api.keys.ExperimenterIdDeserializerKey in project openflowplugin by opendaylight.

the class ExperimenterDeserializerKeyFactoryTest method testCreateMultipartReplyMessageDeserializerKey.

@Test
public void testCreateMultipartReplyMessageDeserializerKey() throws Exception {
    ExperimenterIdDeserializerKey createdKey;
    ExperimenterIdDeserializerKey comparationKey;
    createdKey = ExperimenterDeserializerKeyFactory.createMultipartReplyMessageDeserializerKey(EncodeConstants.OF10_VERSION_ID, 45L, 1L);
    comparationKey = new ExperimenterIdDeserializerKey(EncodeConstants.OF10_VERSION_ID, 45L, ExperimenterDataOfChoice.class);
    Assert.assertEquals("Wrong key created", comparationKey, createdKey);
}
Also used : ExperimenterDataOfChoice(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.experimenter.core.ExperimenterDataOfChoice) ExperimenterIdDeserializerKey(org.opendaylight.openflowjava.protocol.api.keys.ExperimenterIdDeserializerKey) Test(org.junit.Test)

Example 9 with ExperimenterIdDeserializerKey

use of org.opendaylight.openflowjava.protocol.api.keys.ExperimenterIdDeserializerKey in project openflowplugin by opendaylight.

the class ExperimenterIdDeserializerKeyTest method testEquals.

/**
 * Test ExperimenterIdDeserializerKey equals - additional test.
 */
@Test
public void testEquals() {
    ExperimenterIdDeserializerKey key1 = new ExperimenterIdDeserializerKey(EncodeConstants.OF10_VERSION_ID, 0L, ExperimenterMessage.class);
    Assert.assertTrue("Wrong equal to identical object.", key1.equals(key1));
    MessageCodeKey mk = new MessageCodeKey(EncodeConstants.OF10_VERSION_ID, EncodeConstants.EXPERIMENTER_VALUE, ExperimenterMessage.class);
    Assert.assertFalse("Wrong equal to different class.", key1.equals(mk));
    ExperimenterIdDeserializerKey key2 = new ExperimenterIdDeserializerKey(EncodeConstants.OF10_VERSION_ID, 42L, ExperimenterMessage.class);
    Assert.assertFalse("Wrong equal by experimenterId.", key1.equals(key2));
}
Also used : MessageCodeKey(org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey) ExperimenterIdDeserializerKey(org.opendaylight.openflowjava.protocol.api.keys.ExperimenterIdDeserializerKey) Test(org.junit.Test)

Example 10 with ExperimenterIdDeserializerKey

use of org.opendaylight.openflowjava.protocol.api.keys.ExperimenterIdDeserializerKey in project openflowplugin by opendaylight.

the class ExperimenterIdDeserializerKeyTest method test.

/**
 * Test ExperimenterIdDeserializerKey equals and hashCode.
 */
@Test
public void test() {
    ExperimenterIdDeserializerKey key1 = new ExperimenterIdDeserializerKey(EncodeConstants.OF10_VERSION_ID, 42L, ExperimenterMessage.class);
    ExperimenterIdDeserializerKey key2 = new ExperimenterIdDeserializerKey(EncodeConstants.OF10_VERSION_ID, 42L, ExperimenterMessage.class);
    Assert.assertTrue("Wrong equals", key1.equals(key2));
    Assert.assertTrue("Wrong hashcode", key1.hashCode() == key2.hashCode());
    key2 = new ExperimenterIdDeserializerKey(EncodeConstants.OF13_VERSION_ID, 42L, ExperimenterMessage.class);
    Assert.assertFalse("Wrong equals", key1.equals(key2));
    Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
    key2 = new ExperimenterIdDeserializerKey(EncodeConstants.OF10_VERSION_ID, 0L, ExperimenterMessage.class);
    Assert.assertFalse("Wrong equals", key1.equals(key2));
    Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
    key2 = new ExperimenterIdDeserializerKey(EncodeConstants.OF10_VERSION_ID, 55L, ExperimenterMessage.class);
    Assert.assertFalse("Wrong equals", key1.equals(key2));
    Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
    key2 = new ExperimenterIdDeserializerKey(EncodeConstants.OF10_VERSION_ID, 55L, null);
    Assert.assertFalse("Wrong equals", key1.equals(key2));
    Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
    key2 = new ExperimenterIdDeserializerKey(EncodeConstants.OF10_VERSION_ID, 55L, ErrorMessage.class);
    Assert.assertFalse("Wrong equals", key1.equals(key2));
    Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
}
Also used : ExperimenterMessage(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterMessage) ErrorMessage(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ErrorMessage) ExperimenterIdDeserializerKey(org.opendaylight.openflowjava.protocol.api.keys.ExperimenterIdDeserializerKey) Test(org.junit.Test)

Aggregations

ExperimenterIdDeserializerKey (org.opendaylight.openflowjava.protocol.api.keys.ExperimenterIdDeserializerKey)14 Test (org.junit.Test)11 ExperimenterDataOfChoice (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.experimenter.core.ExperimenterDataOfChoice)6 ErrorMessage (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ErrorMessage)3 ArrayList (java.util.ArrayList)2 ExperimenterIdTypeDeserializerKey (org.opendaylight.openflowjava.protocol.api.keys.ExperimenterIdTypeDeserializerKey)2 MessageCodeKey (org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey)2 MeterBandType (org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterBandType)2 MeterId (org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterId)2 DropBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.band.type.band.type.DropBuilder)2 DscpRemarkBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.band.type.band.type.DscpRemarkBuilder)2 MeterBandHeadersBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.MeterBandHeadersBuilder)2 MeterBandHeader (org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.meter.band.headers.MeterBandHeader)2 MeterBandHeaderBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.meter.band.headers.MeterBandHeaderBuilder)2 MeterBandTypesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.meter.band.headers.meter.band.header.MeterBandTypesBuilder)2 MeterBandExperimenterCase (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.meter.band.header.meter.band.MeterBandExperimenterCase)2 TableFeatureProperties (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.table.features.properties.grouping.TableFeatureProperties)2 OFDeserializer (org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer)1 ExperimenterActionDeserializerKey (org.opendaylight.openflowjava.protocol.api.keys.ExperimenterActionDeserializerKey)1 ExperimenterActionSerializerKey (org.opendaylight.openflowjava.protocol.api.keys.ExperimenterActionSerializerKey)1