use of org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry in project openflowplugin by opendaylight.
the class HelloMessageFactoryTest method startUp.
@Before
public void startUp() {
SerializerRegistry registry = new SerializerRegistryImpl();
registry.init();
factory = registry.getSerializer(new MessageTypeKey<>(EncodeConstants.OF13_VERSION_ID, HelloMessage.class));
}
use of org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry in project openflowplugin by opendaylight.
the class SerializationFactoryTest method test.
/**
* Test serializer lookup & serialization.
*/
@Test
public void test() {
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(EncodeConstants.OF10_VERSION_ID, buffer, helloBuilder.build());
assertEquals("Serialization failed", EncodeConstants.OFHEADER_SIZE, buffer.readableBytes());
}
use of org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry in project openflowplugin by opendaylight.
the class BarrierReplyMessageFactoryTest method startUp.
@Before
public void startUp() throws Exception {
SerializerRegistry registry = new SerializerRegistryImpl();
registry.init();
factory = registry.getSerializer(new MessageTypeKey<>(EncodeConstants.OF13_VERSION_ID, BarrierOutput.class));
}
use of org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry in project openflowplugin by opendaylight.
the class EchoRequestMessageFactoryTest method startUp.
@Before
public void startUp() {
SerializerRegistry registry = new SerializerRegistryImpl();
registry.init();
factory = registry.getSerializer(new MessageTypeKey<>(EncodeConstants.OF13_VERSION_ID, EchoRequestMessage.class));
}
use of org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry in project openflowplugin by opendaylight.
the class ErrorMessageFactoryTest method startUp.
@Before
public void startUp() {
SerializerRegistry registry = new SerializerRegistryImpl();
registry.init();
factory = registry.getSerializer(new MessageTypeKey<>(EncodeConstants.OF13_VERSION_ID, ErrorMessage.class));
}
Aggregations