Search in sources :

Example 1 with TranslatorKeyFactory

use of org.opendaylight.openflowplugin.impl.translator.TranslatorKeyFactory in project openflowplugin by opendaylight.

the class TranslatorLibratyUtilTest method setBasicTranslatorLibraryTest.

@Test
public void setBasicTranslatorLibraryTest() {
    final ConvertorManager convertorManager = ConvertorManagerFactory.createDefaultManager();
    TranslatorLibraryUtil.injectBasicTranslatorLibrary(translatorLibrarian, convertorManager);
    TranslatorLibrary translatorLibrary = translatorLibrarian.oook();
    TranslatorKeyFactory of13TranslatorKeyFactory = new TranslatorKeyFactory(OFP_VERSION_1_3);
    MessageTranslator<Object, Object> translator;
    translator = translatorLibrary.lookupTranslator(of13TranslatorKeyFactory.createTranslatorKey(PacketIn.class));
    assertNotNull(translator);
    translator = translatorLibrary.lookupTranslator(of13TranslatorKeyFactory.createTranslatorKey(PortGrouping.class));
    assertNotNull(translator);
    translator = translatorLibrary.lookupTranslator(of13TranslatorKeyFactory.createTranslatorKey(MultipartReplyAggregateCase.class));
    assertNotNull(translator);
    TranslatorKeyFactory of10TranslatorKeyFactory = new TranslatorKeyFactory(OFP_VERSION_1_0);
    translator = translatorLibrary.lookupTranslator(of10TranslatorKeyFactory.createTranslatorKey(PacketIn.class));
    assertNotNull(translator);
    translator = translatorLibrary.lookupTranslator(of10TranslatorKeyFactory.createTranslatorKey(PortGrouping.class));
    assertNotNull(translator);
    translator = translatorLibrary.lookupTranslator(of10TranslatorKeyFactory.createTranslatorKey(MultipartReplyAggregateCase.class));
    assertNotNull(translator);
}
Also used : TranslatorLibrary(org.opendaylight.openflowplugin.api.openflow.device.TranslatorLibrary) TranslatorKeyFactory(org.opendaylight.openflowplugin.impl.translator.TranslatorKeyFactory) ConvertorManager(org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManager) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 TranslatorLibrary (org.opendaylight.openflowplugin.api.openflow.device.TranslatorLibrary)1 TranslatorKeyFactory (org.opendaylight.openflowplugin.impl.translator.TranslatorKeyFactory)1 ConvertorManager (org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManager)1