Search in sources :

Example 6 with ConvertorManager

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

the class OpendaylightMeterStatisticsServiceImplTest method setUp.

public void setUp() {
    final ConvertorManager convertorManager = ConvertorManagerFactory.createDefaultManager();
    meterStatisticsService = new OpendaylightMeterStatisticsServiceImpl(rqContextStack, deviceContext, new AtomicLong(), notificationPublishService, convertorManager);
    Mockito.doAnswer(answerVoidToCallback).when(outboundQueueProvider).commitEntry(Matchers.eq(42L), requestInput.capture(), Matchers.any(FutureCallback.class));
}
Also used : AtomicLong(java.util.concurrent.atomic.AtomicLong) ConvertorManager(org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManager) FutureCallback(com.google.common.util.concurrent.FutureCallback)

Example 7 with ConvertorManager

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

the class StatisticsGatheringOnTheFlyServiceTest method setup.

@Override
protected void setup() {
    final ConvertorManager convertorManager = ConvertorManagerFactory.createDefaultManager();
    statisticsGatheringService = new StatisticsGatheringOnTheFlyService<>(mockedRequestContextStack, mockedDeviceContext, convertorManager, MultipartWriterProviderFactory.createDefaultProvider(mockedDeviceContext));
    Mockito.doReturn(NODE_ID).when(mockedPrimConnectionContext).getNodeId();
    Mockito.when(mockedDeviceInfo.getNodeId()).thenReturn(NODE_ID);
    Mockito.when(mockedDeviceContext.getDeviceInfo().getNodeId()).thenReturn(NODE_ID);
}
Also used : ConvertorManager(org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManager)

Example 8 with ConvertorManager

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

the class OpendaylightFlowStatisticsServiceDelegateImplTest method setUp.

@Override
public void setUp() {
    final ConvertorManager convertorManager = ConvertorManagerFactory.createDefaultManager();
    flowStatisticsServiceDelegate = new OpendaylightFlowStatisticsServiceDelegateImpl(rqContextStack, deviceContext, notificationPublishService, new AtomicLong(21), convertorManager);
    Mockito.doAnswer(answerVoidToCallback).when(outboundQueueProvider).commitEntry(Matchers.eq(42L), requestInput.capture(), Matchers.any(FutureCallback.class));
    Mockito.when(translatorLibrary.lookupTranslator(Matchers.<TranslatorKey>any())).thenReturn(translator);
}
Also used : AtomicLong(java.util.concurrent.atomic.AtomicLong) ConvertorManager(org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManager) FutureCallback(com.google.common.util.concurrent.FutureCallback)

Example 9 with ConvertorManager

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

the class PacketProcessingServiceImplTest method setup.

@Override
protected void setup() {
    final ConvertorManager convertorManager = ConvertorManagerFactory.createDefaultManager();
    packetProcessingService = new PacketProcessingServiceImpl(mockedRequestContextStack, mockedDeviceContext, convertorManager);
    pathToNodeconnector = KeyedInstanceIdentifier.create(Nodes.class).child(Node.class, new NodeKey(new NodeId("ofp-ut:123"))).child(NodeConnector.class, new NodeConnectorKey(new NodeConnectorId("ofp-ut:123:1")));
}
Also used : NodeConnector(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector) NodeConnectorId(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId) NodeId(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId) ConvertorManager(org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManager) NodeKey(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey) Nodes(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes) NodeConnectorKey(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey)

Example 10 with ConvertorManager

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

the class OpendaylightFlowStatisticsServiceImpl1Test method setUp.

public void setUp() {
    final ConvertorManager convertorManager = ConvertorManagerFactory.createDefaultManager();
    flowStatisticsService = OpendaylightFlowStatisticsServiceImpl.createWithOook(rqContextStack, deviceContext, convertorManager);
    AbstractRequestContext<Object> rqContext = new AbstractRequestContext<Object>(42L) {

        @Override
        public void close() {
        // NOOP
        }
    };
    Mockito.when(rqContextStack.<Object>createRequestContext()).thenReturn(rqContext);
}
Also used : AbstractRequestContext(org.opendaylight.openflowplugin.impl.rpc.AbstractRequestContext) ConvertorManager(org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManager)

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