use of org.opendaylight.openflowjava.protocol.impl.util.OF13MatchSerializer in project openflowplugin by opendaylight.
the class SerializerRegistryImpl method init.
@Override
public void init() {
registry = new HashMap<>();
// Openflow message type serializers
MessageFactoryInitializer.registerMessageSerializers(this);
// Register Additional serializers
AdditionalMessageFactoryInitializer.registerMessageSerializers(this);
// match structure serializers
registerSerializer(new MessageTypeKey<>(OF10, MatchV10.class), new OF10MatchSerializer());
registerSerializer(new MessageTypeKey<>(OF13, Match.class), new OF13MatchSerializer());
// match entry serializers
MatchEntriesInitializer.registerMatchEntrySerializers(this);
// action serializers
ActionsInitializer.registerActionSerializers(this);
// instruction serializers
InstructionsInitializer.registerInstructionSerializers(this);
}
use of org.opendaylight.openflowjava.protocol.impl.util.OF13MatchSerializer in project openflowplugin by opendaylight.
the class SerializerRegistryImplTest method testUnRegisterSerializerNoMessageTypeKey.
/**
* Test - unregister serializer without MessageTypeKey.
*/
@Test(expected = IllegalArgumentException.class)
public void testUnRegisterSerializerNoMessageTypeKey() {
SerializerRegistryImpl serReg = new SerializerRegistryImpl();
serReg.init();
serReg.registerSerializer(new MessageTypeKey<>(OF13, Match.class), new OF13MatchSerializer());
serReg.unregisterSerializer(null);
}
use of org.opendaylight.openflowjava.protocol.impl.util.OF13MatchSerializer in project openflowplugin by opendaylight.
the class SerializerRegistryImplTest method testUnRegisterSerializer.
/**
* Test - unregister serializer.
*/
@Test
public void testUnRegisterSerializer() {
SerializerRegistryImpl serReg = new SerializerRegistryImpl();
serReg.init();
serReg.registerSerializer(new MessageTypeKey<>(OF13, Match.class), new OF13MatchSerializer());
Assert.assertTrue("Wrong - unregister serializer", serReg.unregisterSerializer(new MessageTypeKey<>(OF13, Match.class)));
serReg.registerSerializer(new MessageTypeKey<>(OF13, Match.class), new OF13MatchSerializer());
Assert.assertFalse("Wrong - unregister serializer", serReg.unregisterSerializer(new MessageTypeKey<>(OF10, Match.class)));
}
Aggregations