Search in sources :

Example 1 with RemoveMappingInput

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);
}
Also used : RemoveMappingInput(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.RemoveMappingInput) Test(org.junit.Test)

Example 2 with RemoveMappingInput

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());
}
Also used : RemoveMappingInput(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.RemoveMappingInput) RpcResult(org.opendaylight.yangtools.yang.common.RpcResult) RemoveMappingInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.RemoveMappingInputBuilder) Test(org.junit.Test)

Example 3 with RemoveMappingInput

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();
}
Also used : RemoveMappingInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.RemoveMappingInputBuilder)

Example 4 with RemoveMappingInput

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);
}
Also used : PortUuidToPortDataMapper(org.opendaylight.lispflowmapping.neutron.mappingmanager.mappers.PortUuidToPortDataMapper) RemoveMappingInput(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.RemoveMappingInput)

Example 5 with RemoveMappingInput

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);
}
Also used : RemoveMappingInput(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.RemoveMappingInput) AddMappingInput(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.AddMappingInput) Test(org.junit.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Aggregations

RemoveMappingInput (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.RemoveMappingInput)5 Test (org.junit.Test)4 RemoveMappingInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.RemoveMappingInputBuilder)3 PortUuidToPortDataMapper (org.opendaylight.lispflowmapping.neutron.mappingmanager.mappers.PortUuidToPortDataMapper)1 AddMappingInput (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.AddMappingInput)1 RpcResult (org.opendaylight.yangtools.yang.common.RpcResult)1 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)1