Search in sources :

Example 16 with MessageCodeKey

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

the class MultipartRequestDescInputMessageFactoryTest method startUp.

@Before
public void startUp() {
    DeserializerRegistry desRegistry = new DeserializerRegistryImpl();
    desRegistry.init();
    factory = desRegistry.getDeserializer(new MessageCodeKey(EncodeConstants.OF13_VERSION_ID, 18, MultipartRequestInput.class));
}
Also used : MessageCodeKey(org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey) DeserializerRegistryImpl(org.opendaylight.openflowjava.protocol.impl.deserialization.DeserializerRegistryImpl) DeserializerRegistry(org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry) Before(org.junit.Before)

Example 17 with MessageCodeKey

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

the class DeserializerRegistryImplTest method testRegisterDeserializerNoDeserializer.

/**
 * Test - register deserializer with no deserializer.
 */
@Test(expected = IllegalArgumentException.class)
public void testRegisterDeserializerNoDeserializer() {
    DeserializerRegistryImpl serReg = new DeserializerRegistryImpl();
    serReg.registerDeserializer(new MessageCodeKey(OF13, EMPTY_VALUE, Match.class), null);
}
Also used : MessageCodeKey(org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey) Match(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.Match) Test(org.junit.Test)

Example 18 with MessageCodeKey

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

the class DeserializerRegistryImplTest method testGetDeserializer.

/**
 * Test - get deserializer.
 */
@Test(expected = IllegalStateException.class)
public void testGetDeserializer() {
    DeserializerRegistryImpl registry = new DeserializerRegistryImpl();
    registry.init();
    registry.getDeserializer(new MessageCodeKey((short) 5000, EncodeConstants.EMPTY_VALUE, MatchV10.class));
    Assert.fail();
}
Also used : MessageCodeKey(org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey) MatchV10(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10) Test(org.junit.Test)

Example 19 with MessageCodeKey

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

the class GetFeaturesInputFactoryTest method startUp.

@Before
public void startUp() {
    DeserializerRegistry registry = new DeserializerRegistryImpl();
    registry.init();
    factory = registry.getDeserializer(new MessageCodeKey(EncodeConstants.OF13_VERSION_ID, 5, GetFeaturesInput.class));
}
Also used : MessageCodeKey(org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey) DeserializerRegistryImpl(org.opendaylight.openflowjava.protocol.impl.deserialization.DeserializerRegistryImpl) DeserializerRegistry(org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry) Before(org.junit.Before)

Example 20 with MessageCodeKey

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

the class RoleReplyMessageFactoryTest method startUp.

/**
 * Initializes deserializer registry and lookups correct deserializer.
 */
@Before
public void startUp() {
    DeserializerRegistry registry = new DeserializerRegistryImpl();
    registry.init();
    roleFactory = registry.getDeserializer(new MessageCodeKey(EncodeConstants.OF13_VERSION_ID, 25, RoleRequestOutput.class));
}
Also used : MessageCodeKey(org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey) DeserializerRegistryImpl(org.opendaylight.openflowjava.protocol.impl.deserialization.DeserializerRegistryImpl) DeserializerRegistry(org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry) Before(org.junit.Before)

Aggregations

MessageCodeKey (org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey)85 Before (org.junit.Before)52 DeserializerRegistryImpl (org.opendaylight.openflowjava.protocol.impl.deserialization.DeserializerRegistryImpl)52 DeserializerRegistry (org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry)51 Test (org.junit.Test)16 ByteBuf (io.netty.buffer.ByteBuf)10 BigInteger (java.math.BigInteger)8 Match (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.Match)7 MatchV10 (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10)7 SuppressFBWarnings (edu.umd.cs.findbugs.annotations.SuppressFBWarnings)4 ArrayList (java.util.ArrayList)4 ActionDeserializerKey (org.opendaylight.openflowjava.protocol.api.keys.ActionDeserializerKey)4 CodeKeyMaker (org.opendaylight.openflowjava.protocol.impl.util.CodeKeyMaker)4 ExperimenterActionDeserializerKey (org.opendaylight.openflowjava.protocol.api.keys.ExperimenterActionDeserializerKey)3 MatchEntryDeserializerKey (org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey)3 ExperimenterIdDeserializerKey (org.opendaylight.openflowjava.protocol.api.keys.ExperimenterIdDeserializerKey)2 InstructionDeserializerKey (org.opendaylight.openflowjava.protocol.api.keys.InstructionDeserializerKey)2 TypeToClassKey (org.opendaylight.openflowjava.protocol.api.keys.TypeToClassKey)2 DefaultDeserializerFactoryTest (org.opendaylight.openflowjava.protocol.impl.util.DefaultDeserializerFactoryTest)2 MessageCodeExperimenterKey (org.opendaylight.openflowplugin.api.openflow.protocol.deserialization.MessageCodeExperimenterKey)2