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();
}
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));
}
Aggregations