use of org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry in project openflowplugin by opendaylight.
the class EchoOutputMessageFactoryTest method startUp.
@Before
public void startUp() {
SerializerRegistry registry = new SerializerRegistryImpl();
registry.init();
factory = registry.getSerializer(new MessageTypeKey<>(EncodeConstants.OF13_VERSION_ID, EchoOutput.class));
}
use of org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry in project openflowplugin by opendaylight.
the class ExperimenterInputMessageFactoryTest method startUp.
/**
* Sets up ExperimenterInputMessageFactory.
* @param real true if setup should use real registry, false when mock is desired
*/
public void startUp(boolean real) {
MockitoAnnotations.initMocks(this);
expFactory = new ExperimenterInputMessageFactory();
if (real) {
SerializerRegistry realRegistry = new SerializerRegistryImpl();
realRegistry.init();
((SerializerRegistryInjector) expFactory).injectSerializerRegistry(realRegistry);
} else {
((SerializerRegistryInjector) expFactory).injectSerializerRegistry(registry);
}
}
use of org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry in project openflowplugin by opendaylight.
the class OF10PortStatusMessageFactoryTest method startUp.
@Before
public void startUp() {
SerializerRegistry registry = new SerializerRegistryImpl();
registry.init();
factory = registry.getSerializer(new MessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, PortStatusMessage.class));
}
use of org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry in project openflowplugin by opendaylight.
the class GetAsyncReplyMessageFactoryTest method testSetAsyncInputWithNullMasks.
@Test
public void testSetAsyncInputWithNullMasks() throws Exception {
GetAsyncOutputBuilder builder = new GetAsyncOutputBuilder();
BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
builder.setPacketInMask(null);
builder.setPortStatusMask(null);
builder.setFlowRemovedMask(null);
GetAsyncOutput message = builder.build();
GetAsyncReplyMessageFactory serializer = new GetAsyncReplyMessageFactory();
SerializerRegistry registry = new SerializerRegistryImpl();
registry.init();
ByteBuf serializedBuffer = UnpooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(message, serializedBuffer);
BufferHelper.checkHeaderV13(serializedBuffer, MESSAGE_TYPE, 8);
Assert.assertTrue("Unexpected data", serializedBuffer.readableBytes() == 0);
}
use of org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry in project openflowplugin by opendaylight.
the class RoleReplyMessageFactoryTest method startUp.
@Before
public void startUp() {
SerializerRegistry registry = new SerializerRegistryImpl();
registry.init();
factory = registry.getSerializer(new MessageTypeKey<>(EncodeConstants.OF13_VERSION_ID, RoleRequestOutput.class));
}
Aggregations