Search in sources :

Example 1 with ConvertorManager

use of org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManager in project openflowplugin by opendaylight.

the class SalFlowServiceImplTest method mockSalFlowService.

private SalFlowServiceImpl mockSalFlowService(final short version) {
    when(mockedFeatures.getVersion()).thenReturn(version);
    when(mockedFeaturesOutput.getVersion()).thenReturn(version);
    when(mockedDeviceInfo.getVersion()).thenReturn(version);
    final ConvertorManager convertorManager = ConvertorManagerFactory.createDefaultManager();
    return new SalFlowServiceImpl(mockedRequestContextStack, mockedDeviceContext, convertorManager);
}
Also used : ConvertorManager(org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManager)

Example 2 with ConvertorManager

use of org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManager in project openflowplugin by opendaylight.

the class SalGroupServiceImplTest method setup.

@Override
protected void setup() {
    when(mockedDeviceContext.getDeviceGroupRegistry()).thenReturn(mockedDeviceGroupRegistry);
    final ConvertorManager convertorManager = ConvertorManagerFactory.createDefaultManager();
    salGroupService = new SalGroupServiceImpl(mockedRequestContextStack, mockedDeviceContext, convertorManager);
}
Also used : ConvertorManager(org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManager)

Example 3 with ConvertorManager

use of org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManager in project openflowplugin by opendaylight.

the class SalMeterServiceImplTest method setup.

@Override
protected void setup() {
    when(mockedDeviceContext.getDeviceMeterRegistry()).thenReturn(mockedDeviceMeterRegistry);
    final ConvertorManager convertorManager = ConvertorManagerFactory.createDefaultManager();
    salMeterService = new SalMeterServiceImpl(mockedRequestContextStack, mockedDeviceContext, convertorManager);
}
Also used : ConvertorManager(org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManager)

Example 4 with ConvertorManager

use of org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManager in project openflowplugin by opendaylight.

the class SalPortServiceImplTest method setup.

@Override
protected void setup() {
    final ConvertorManager convertorManager = ConvertorManagerFactory.createDefaultManager();
    salPortService = new SalPortServiceImpl(mockedRequestContextStack, mockedDeviceContext, convertorManager);
}
Also used : ConvertorManager(org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManager)

Example 5 with ConvertorManager

use of org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManager in project openflowplugin by opendaylight.

the class SalTableServiceImplTest method setup.

@Override
public void setup() {
    handleResultFuture = SettableFuture.create();
    when(mockedRequestContext.getFuture()).thenReturn(handleResultFuture);
    Mockito.doAnswer((Answer<Void>) invocation -> {
        final FutureCallback<OfHeader> callback = (FutureCallback<OfHeader>) invocation.getArguments()[2];
        callback.onSuccess(null);
        return null;
    }).when(mockedOutboundQueue).commitEntry(Matchers.anyLong(), Matchers.<OfHeader>any(), Matchers.<FutureCallback<OfHeader>>any());
    final ConvertorManager convertorManager = ConvertorManagerFactory.createDefaultManager();
    salTableService = new SalTableServiceImpl(mockedRequestContextStack, mockedDeviceContext, convertorManager, MultipartWriterProviderFactory.createDefaultProvider(mockedDeviceContext));
}
Also used : UpdateTableInput(org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.UpdateTableInput) TableFeaturesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.table.features._case.multipart.reply.table.features.TableFeaturesBuilder) TableFeatures(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeatures) RpcResult(org.opendaylight.yangtools.yang.common.RpcResult) ServiceMocking(org.opendaylight.openflowplugin.impl.services.ServiceMocking) UpdatedTableBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.table.update.UpdatedTableBuilder) Matchers(org.mockito.Matchers) Mock(org.mockito.Mock) RpcProviderRegistry(org.opendaylight.controller.sal.binding.api.RpcProviderRegistry) MultipartWriterProviderFactory(org.opendaylight.openflowplugin.impl.datastore.MultipartWriterProviderFactory) MultipartReplyTableFeaturesCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.MultipartReplyTableFeaturesCaseBuilder) SettableFuture(com.google.common.util.concurrent.SettableFuture) Answer(org.mockito.stubbing.Answer) MultipartReplyTableFeaturesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.table.features._case.MultipartReplyTableFeaturesBuilder) Future(java.util.concurrent.Future) OfHeader(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader) ConvertorManagerFactory(org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManagerFactory) UpdateTableInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.UpdateTableInputBuilder) UpdateTableOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.UpdateTableOutput) Test(org.junit.Test) MultipartReplyMessageBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReplyMessageBuilder) Mockito.when(org.mockito.Mockito.when) FutureCallback(com.google.common.util.concurrent.FutureCallback) Mockito.verify(org.mockito.Mockito.verify) ExecutionException(java.util.concurrent.ExecutionException) Mockito(org.mockito.Mockito) List(java.util.List) ConvertorManager(org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManager) TableFeatureProperties(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.table.features.properties.grouping.TableFeatureProperties) EventIdentifier(org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.EventIdentifier) MultipartReply(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReply) RpcResultBuilder(org.opendaylight.yangtools.yang.common.RpcResultBuilder) MultipartType(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType) Assert(org.junit.Assert) Collections(java.util.Collections) OfHeader(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader) ConvertorManager(org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManager) FutureCallback(com.google.common.util.concurrent.FutureCallback)

Aggregations

ConvertorManager (org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManager)19 List (java.util.List)5 FutureCallback (com.google.common.util.concurrent.FutureCallback)4 Test (org.junit.Test)4 AtomicLong (java.util.concurrent.atomic.AtomicLong)3 Before (org.junit.Before)3 NodeId (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId)3 Nodes (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes)3 NodeKey (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey)3 MultipartReply (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReply)3 EventIdentifier (org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.EventIdentifier)2 Node (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node)2 MultipartType (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType)2 Optional (com.google.common.base.Optional)1 SettableFuture (com.google.common.util.concurrent.SettableFuture)1 ArrayList (java.util.ArrayList)1 Collections (java.util.Collections)1 ExecutionException (java.util.concurrent.ExecutionException)1 Future (java.util.concurrent.Future)1 Assert (org.junit.Assert)1