Search in sources :

Example 6 with PacketProcessingService

use of org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketProcessingService in project genius by opendaylight.

the class AlivenessMonitorTest method setUp.

@SuppressWarnings("unchecked")
@Before
public void setUp() {
    MockitoAnnotations.initMocks(this);
    when(idManager.createIdPool(any(CreateIdPoolInput.class))).thenReturn(Futures.immediateFuture(RpcResultBuilder.<Void>success().build()));
    AlivenessProtocolHandlerRegistry alivenessProtocolHandlerRegistry = new AlivenessProtocolHandlerRegistryImpl();
    alivenessMonitor = new AlivenessMonitor(dataBroker, idManager, notificationPublishService, alivenessProtocolHandlerRegistry);
    arpHandler = new AlivenessProtocolHandlerARP(dataBroker, interfaceManager, alivenessProtocolHandlerRegistry, arpService);
    lldpHandler = new AlivenessProtocolHandlerLLDP(dataBroker, alivenessProtocolHandlerRegistry, packetProcessingService);
    mockId = 1L;
    when(idManager.allocateId(any(AllocateIdInput.class))).thenReturn(Futures.immediateFuture(RpcResultBuilder.success(new AllocateIdOutputBuilder().setIdValue(mockId++).build()).build()));
    when(idManager.releaseId(any(ReleaseIdInput.class))).thenReturn(Futures.immediateFuture(RpcResultBuilder.<Void>success().build()));
    doReturn(readTx).when(dataBroker).newReadOnlyTransaction();
    doReturn(writeTx).when(dataBroker).newWriteOnlyTransaction();
    doReturn(readWriteTx).when(dataBroker).newReadWriteTransaction();
    doNothing().when(writeTx).put(eq(LogicalDatastoreType.OPERATIONAL), any(InstanceIdentifier.class), any(DataObject.class));
    doReturn(Futures.immediateCheckedFuture(null)).when(writeTx).submit();
    doReturn(Futures.immediateCheckedFuture(null)).when(readWriteTx).submit();
}
Also used : DataObject(org.opendaylight.yangtools.yang.binding.DataObject) AllocateIdInput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.AllocateIdInput) AllocateIdOutputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.AllocateIdOutputBuilder) AlivenessProtocolHandlerLLDP(org.opendaylight.genius.alivenessmonitor.protocols.internal.AlivenessProtocolHandlerLLDP) InstanceIdentifier(org.opendaylight.yangtools.yang.binding.InstanceIdentifier) CreateIdPoolInput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.CreateIdPoolInput) AlivenessProtocolHandlerRegistry(org.opendaylight.genius.alivenessmonitor.protocols.AlivenessProtocolHandlerRegistry) ReleaseIdInput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.ReleaseIdInput) AlivenessProtocolHandlerRegistryImpl(org.opendaylight.genius.alivenessmonitor.protocols.internal.AlivenessProtocolHandlerRegistryImpl) AlivenessMonitor(org.opendaylight.genius.alivenessmonitor.internal.AlivenessMonitor) AlivenessProtocolHandlerARP(org.opendaylight.genius.alivenessmonitor.protocols.internal.AlivenessProtocolHandlerARP) Before(org.junit.Before)

Example 7 with PacketProcessingService

use of org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketProcessingService in project openflowplugin by opendaylight.

the class LLDPSpeakerTest method testLocalNodeConnectorCreation.

/**
 * Test that checks if LLDPSpeaker working fine with local ports.
 */
@Test
public void testLocalNodeConnectorCreation() {
    // Call nodeConnectorAdded with local port
    FlowCapableNodeConnector fcnc = TestUtils.createFlowCapableNodeConnector().setPortNumber(new PortNumberUni("LOCAL")).build();
    lldpSpeaker.nodeConnectorAdded(ID, fcnc);
    // Verify that nothing happened for local port
    verify(packetProcessingService, never()).transmitPacket(any(TransmitPacketInput.class));
}
Also used : PortNumberUni(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortNumberUni) TransmitPacketInput(org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.TransmitPacketInput) FlowCapableNodeConnector(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector) Test(org.junit.Test)

Aggregations

Before (org.junit.Before)2 NodeConnectorId (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId)2 NodeId (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId)2 Nodes (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes)2 Node (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node)2 TimeUnit (java.util.concurrent.TimeUnit)1 Test (org.junit.Test)1 DataBroker (org.opendaylight.controller.md.sal.binding.api.DataBroker)1 DataTreeIdentifier (org.opendaylight.controller.md.sal.binding.api.DataTreeIdentifier)1 NotificationService (org.opendaylight.controller.sal.binding.api.NotificationService)1 AlivenessMonitor (org.opendaylight.genius.alivenessmonitor.internal.AlivenessMonitor)1 AlivenessProtocolHandlerRegistry (org.opendaylight.genius.alivenessmonitor.protocols.AlivenessProtocolHandlerRegistry)1 AlivenessProtocolHandlerARP (org.opendaylight.genius.alivenessmonitor.protocols.internal.AlivenessProtocolHandlerARP)1 AlivenessProtocolHandlerLLDP (org.opendaylight.genius.alivenessmonitor.protocols.internal.AlivenessProtocolHandlerLLDP)1 AlivenessProtocolHandlerRegistryImpl (org.opendaylight.genius.alivenessmonitor.protocols.internal.AlivenessProtocolHandlerRegistryImpl)1 FlowCommitWrapper (org.opendaylight.openflowplugin.learningswitch.FlowCommitWrapper)1 FlowCommitWrapperImpl (org.opendaylight.openflowplugin.learningswitch.FlowCommitWrapperImpl)1 LearningSwitchHandlerSimpleImpl (org.opendaylight.openflowplugin.learningswitch.LearningSwitchHandlerSimpleImpl)1 WakeupOnNode (org.opendaylight.openflowplugin.learningswitch.WakeupOnNode)1 LearningSwitchManagerMultiImpl (org.opendaylight.openflowplugin.learningswitch.multi.LearningSwitchManagerMultiImpl)1