Search in sources :

Example 16 with SerializerRegistry

use of org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry in project openflowplugin by opendaylight.

the class OF10FeaturesReplyMessageFactoryTest method startUp.

@Before
public void startUp() {
    SerializerRegistry registry = new SerializerRegistryImpl();
    registry.init();
    factory = registry.getSerializer(new MessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, GetFeaturesOutput.class));
}
Also used : SerializerRegistry(org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry) SerializerRegistryImpl(org.opendaylight.openflowjava.protocol.impl.serialization.SerializerRegistryImpl) MessageTypeKey(org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey) Before(org.junit.Before)

Example 17 with SerializerRegistry

use of org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry in project openflowplugin by opendaylight.

the class OF10FlowRemovedMessageFactoryTest method startUp.

@Before
public void startUp() {
    SerializerRegistry registry = new SerializerRegistryImpl();
    registry.init();
    factory = registry.getSerializer(new MessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, FlowRemovedMessage.class));
}
Also used : SerializerRegistry(org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry) SerializerRegistryImpl(org.opendaylight.openflowjava.protocol.impl.serialization.SerializerRegistryImpl) MessageTypeKey(org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey) Before(org.junit.Before)

Example 18 with SerializerRegistry

use of org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry in project openflowplugin by opendaylight.

the class OF10PacketInMessageFactoryTest method startUp.

@Before
public void startUp() {
    SerializerRegistry registry = new SerializerRegistryImpl();
    registry.init();
    factory = registry.getSerializer(new MessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, PacketInMessage.class));
}
Also used : SerializerRegistry(org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry) SerializerRegistryImpl(org.opendaylight.openflowjava.protocol.impl.serialization.SerializerRegistryImpl) MessageTypeKey(org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey) Before(org.junit.Before)

Example 19 with SerializerRegistry

use of org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry in project openflowplugin by opendaylight.

the class QueueGetConfigReplyMessageFactoryTest method startUp.

@Before
public void startUp() {
    SerializerRegistry registry = new SerializerRegistryImpl();
    registry.init();
    factory = registry.getSerializer(new MessageTypeKey<>(EncodeConstants.OF13_VERSION_ID, GetQueueConfigOutput.class));
}
Also used : SerializerRegistry(org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry) SerializerRegistryImpl(org.opendaylight.openflowjava.protocol.impl.serialization.SerializerRegistryImpl) MessageTypeKey(org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey) Before(org.junit.Before)

Example 20 with SerializerRegistry

use of org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry in project openflowplugin by opendaylight.

the class SerializationFactoryTest method testNotExistingSerializer.

/**
 * Test serializer not found scenario.
 */
@Test(expected = IllegalStateException.class)
public void testNotExistingSerializer() {
    SerializerRegistry registry = new SerializerRegistryImpl();
    registry.init();
    final SerializationFactory factory = new SerializationFactory(registry);
    final ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
    HelloInputBuilder helloBuilder = new HelloInputBuilder();
    helloBuilder.setVersion((short) EncodeConstants.OF10_VERSION_ID);
    helloBuilder.setXid(123456L);
    helloBuilder.setElements(null);
    factory.messageToBuffer((short) 0, buffer, helloBuilder.build());
}
Also used : SerializerRegistry(org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry) ByteBuf(io.netty.buffer.ByteBuf) HelloInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloInputBuilder) Test(org.junit.Test)

Aggregations

SerializerRegistry (org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry)25 SerializerRegistryImpl (org.opendaylight.openflowjava.protocol.impl.serialization.SerializerRegistryImpl)23 Before (org.junit.Before)21 MessageTypeKey (org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey)21 ByteBuf (io.netty.buffer.ByteBuf)3 Test (org.junit.Test)3 HelloInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloInputBuilder)2 SerializerRegistryInjector (org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistryInjector)1 GetAsyncOutput (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetAsyncOutput)1 GetAsyncOutputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetAsyncOutputBuilder)1