use of org.opensmartgridplatform.domain.core.valueobjects.CdmaDevice in project open-smart-grid-platform by OSGP.
the class CdmaRunTest method tenDevices.
@Test
public void tenDevices() {
final CdmaRun run = new CdmaRun();
for (int i = 0; i < 10; i++) {
run.add(new CdmaDevice("cd" + i, this.loopbackAddress, "200/1", (short) 1));
}
this.service.setTransitionForCdmaRun(run, "LianderNetManagement", "ten-devices-cdma-run-test", TransitionType.DAY_NIGHT);
this.verifySentMessages(10);
}
use of org.opensmartgridplatform.domain.core.valueobjects.CdmaDevice in project open-smart-grid-platform by OSGP.
the class CdmaRunTest method threeBatchesNoDelay.
@Test
public void threeBatchesNoDelay() {
// Set a delay of 0 seconds for this scenario
this.service = new SetTransitionService(Executors.newScheduledThreadPool(1), 0);
MockitoAnnotations.initMocks(this);
final CdmaRun run = new CdmaRun();
for (short i = 0; i < 3; i++) {
run.add(new CdmaDevice("cd" + i, this.loopbackAddress, "200/1", i));
}
this.service.setTransitionForCdmaRun(run, "LianderNetManagement", "ten-batches-cdma-run-test", TransitionType.DAY_NIGHT);
this.verifySentMessages(3);
}
use of org.opensmartgridplatform.domain.core.valueobjects.CdmaDevice in project open-smart-grid-platform by OSGP.
the class CdmaRunTest method oneDevice.
@Test
public void oneDevice() {
final CdmaRun run = new CdmaRun();
run.add(new CdmaDevice("cd1", this.loopbackAddress, "200/1", (short) 1));
this.service.setTransitionForCdmaRun(run, "LianderNetManagement", "one-device-cdma-run-test", TransitionType.NIGHT_DAY);
this.verifySentMessages(1);
}
use of org.opensmartgridplatform.domain.core.valueobjects.CdmaDevice in project open-smart-grid-platform by OSGP.
the class CdmaRunTest method itemPerMastSegment.
@Test
public void itemPerMastSegment() {
final CdmaRun run = new CdmaRun();
for (int i = 0; i < 5; i++) {
run.add(new CdmaDevice("cd" + i, this.loopbackAddress, "200/" + i, (short) 1));
}
final Iterator<CdmaMastSegment> iterator = run.getMastSegmentIterator();
for (int i = 0; i < 5; i++) {
iterator.next();
}
assertThat(iterator.hasNext()).withFailMessage("Iterator should not have any items left").isFalse();
}
use of org.opensmartgridplatform.domain.core.valueobjects.CdmaDevice in project open-smart-grid-platform by OSGP.
the class AdHocManagementService method getCdmaDevicesPerMastSegment.
private CdmaRun getCdmaDevicesPerMastSegment(final LightMeasurementDevice lmd) {
// Find all SSLDs which need to receive a SET_TRANSITION message.
final List<CdmaDevice> devicesForLmd = this.ssldRepository.findCdmaBatchDevicesInUseForLmd(lmd, DeviceLifecycleStatus.IN_USE);
final CdmaRun cdmaRun = new CdmaRun();
devicesForLmd.forEach(cdmaRun::add);
return cdmaRun;
}
Aggregations