use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.AddMappingInput in project lispflowmapping by opendaylight.
the class LispUtil method buildAddMappingInput.
// private static final Logger LOG = LoggerFactory.getLogger(LispUtil.class);
public static AddMappingInput buildAddMappingInput(Eid eid, List<LocatorRecord> locators) {
MappingRecordBuilder mrb = new MappingRecordBuilder();
mrb.setAction(Action.NoAction).setAuthoritative(true).setEid(eid).setLocatorRecord(locators).setMapVersion((short) 0).setRecordTtl(1440);
AddMappingInputBuilder mib = new AddMappingInputBuilder();
mib.setMappingRecord(mrb.build());
return mib.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.AddMappingInput in project lispflowmapping by opendaylight.
the class HostInformationManagerTest method testScenarioPortDataFirst.
@Test
public void testScenarioPortDataFirst() {
HostInformationManager hostInformationManager = getDefaultHostInformationManager();
addPortData1(hostInformationManager);
Mockito.verify(lfmDbService, Mockito.times(0)).addMapping(Mockito.any(AddMappingInput.class));
addRlocData(hostInformationManager);
AddMappingInput desiredMappingRecord = createAddMappingInput(SAMPLE_RLOC, SAMPLE_EID_1);
Mockito.verify(lfmDbService).addMapping(desiredMappingRecord);
destroySingleton(hostInformationManager);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.AddMappingInput in project lispflowmapping by opendaylight.
the class HostInformationManagerTest method testScenarioRlocFirst.
@Test
public void testScenarioRlocFirst() {
HostInformationManager hostInformationManager = getDefaultHostInformationManager();
addRlocData(hostInformationManager);
Mockito.verify(lfmDbService, Mockito.times(0)).addMapping(Mockito.any(AddMappingInput.class));
addPortData1(hostInformationManager);
AddMappingInput desiredMappingRecord = createAddMappingInput(SAMPLE_RLOC, SAMPLE_EID_1);
Mockito.verify(lfmDbService).addMapping(desiredMappingRecord);
destroySingleton(hostInformationManager);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.AddMappingInput in project lispflowmapping by opendaylight.
the class LispUtilTest method buildAddMappingInputTest.
/**
* Tests {@link LispUtil#buildAddMappingInput} method.
*/
@Test
public void buildAddMappingInputTest() {
final MappingRecord mappingRecord = new MappingRecordBuilder().setAction(MappingRecord.Action.NoAction).setAuthoritative(true).setEid(EID).setLocatorRecord(Lists.newArrayList(getDefaultLocatorRecord())).setMapVersion((short) 0).setRecordTtl(RECORD_TTL).build();
final AddMappingInput expectedResult = new AddMappingInputBuilder().setMappingRecord(mappingRecord).build();
final AddMappingInput result = LispUtil.buildAddMappingInput(EID, Lists.newArrayList(LOCATOR_RECORD));
assertEquals(expectedResult, result);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.AddMappingInput in project lispflowmapping by opendaylight.
the class HostInformationManagerTest method testOnlyUnprocessedPortDataIsBeingProcessed.
@Test
public void testOnlyUnprocessedPortDataIsBeingProcessed() {
HostInformationManager hostInformationManager = getDefaultHostInformationManager();
addPortData1(hostInformationManager);
Mockito.verify(lfmDbService, Mockito.times(0)).addMapping(Mockito.any(AddMappingInput.class));
addRlocData(hostInformationManager);
addPortData2(hostInformationManager);
Mockito.verify(lfmDbService, Mockito.times(2)).addMapping(Mockito.any(AddMappingInput.class));
AddMappingInput desiredMappingRecord1 = createAddMappingInput(SAMPLE_RLOC, SAMPLE_EID_1);
Mockito.verify(lfmDbService).addMapping(desiredMappingRecord1);
AddMappingInput desiredMappingRecord2 = createAddMappingInput(SAMPLE_RLOC, SAMPLE_EID_2);
Mockito.verify(lfmDbService).addMapping(desiredMappingRecord2);
destroySingleton(hostInformationManager);
}
Aggregations