use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.RemoveMappingInput in project lispflowmapping by opendaylight.
the class PortDataProcessorTest method deleteTest.
/**
* Tests {@link PortDataProcessor#delete} method.
*/
@Test
public void deleteTest() {
// expected result
final RemoveMappingInput expectedResult = LispUtil.buildRemoveMappingInput(LispAddressUtil.asIpv4PrefixEid(IPV4 + "/32"));
portDataProcessor.delete(portMock);
Mockito.verify(odlMappingserviceServiceMock).removeMapping(expectedResult);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.RemoveMappingInput in project lispflowmapping by opendaylight.
the class MappingServiceTest method removeMappingTest.
/**
* Tests {@link MappingService#removeMapping} method.
*/
@Test
public void removeMappingTest() throws ExecutionException, InterruptedException {
final RemoveMappingInput removeMappingInput = new RemoveMappingInputBuilder().setEid(IPV4_EID).build();
final Future<RpcResult<Void>> result = mappingService.removeMapping(removeMappingInput);
Mockito.verify(dsbe).removeMapping(RPCInputConvertorUtil.toMapping(removeMappingInput));
assertEquals(RPC_RESULT_SUCCESS.getErrors(), result.get().getErrors());
assertEquals(RPC_RESULT_SUCCESS.getResult(), result.get().getResult());
assertEquals(RPC_RESULT_SUCCESS.isSuccessful(), result.get().isSuccessful());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.RemoveMappingInput in project lispflowmapping by opendaylight.
the class LispUtil method buildRemoveMappingInput.
public static RemoveMappingInput buildRemoveMappingInput(Eid eid) {
RemoveMappingInputBuilder rmib = new RemoveMappingInputBuilder();
rmib.setEid(eid);
return rmib.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.RemoveMappingInput in project lispflowmapping by opendaylight.
the class HostInformationManager method attemptToDeleteMappingRecord.
private synchronized void attemptToDeleteMappingRecord(String hostId, String portUuid) {
PortUuidToPortDataMapper uuidToEidMapper = hostIdToPortDataMapper.getAllPortData(hostId);
if (uuidToEidMapper == null) {
return;
}
PortData oldPortData = uuidToEidMapper.getProcessedPortData(portUuid);
if (oldPortData == null) {
return;
}
RemoveMappingInput removeMappingInput = LispUtil.buildRemoveMappingInput(oldPortData.getPortEid());
lfmDbService.removeMapping(removeMappingInput);
uuidToEidMapper.deleteProcessedPortData(portUuid);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.RemoveMappingInput in project lispflowmapping by opendaylight.
the class HostInformationManagerTest method testProperMappingRecordRemoval.
@Test
public void testProperMappingRecordRemoval() {
HostInformationManager hostInformationManager = getDefaultHostInformationManager();
addPortData1(hostInformationManager);
addRlocData(hostInformationManager);
addUpdatedPortData1(hostInformationManager);
RemoveMappingInput removeMappingInput = LispUtil.buildRemoveMappingInput(PORT_DATA_1.getPortEid());
Mockito.verify(lfmDbService).removeMapping(removeMappingInput);
AddMappingInput addMappingInput = createAddMappingInput(SAMPLE_RLOC, SAMPLE_EID_3);
Mockito.verify(lfmDbService).addMapping(addMappingInput);
destroySingleton(hostInformationManager);
}
Aggregations