use of org.ovirt.engine.core.utils.RandomUtils in project ovirt-engine by oVirt.
the class RefreshLunsSizeCommandTest method createLunMap.
private Map<String, List<Pair<VDS, LUNs>>> createLunMap(boolean sameLunSizesPerHost) {
RandomUtils rnd = RandomUtils.instance();
String lunId = rnd.nextString(34);
int lunSize = rnd.nextInt();
List<Pair<VDS, LUNs>> lunList = new ArrayList<>();
for (int i = 0; i < 10; i++) {
LUNs lun = new LUNs();
if (!sameLunSizesPerHost) {
lunSize++;
}
lun.setDeviceSize(lunSize);
lunList.add(new Pair<>(new VDS(), lun));
}
return Collections.singletonMap(lunId, lunList);
}
use of org.ovirt.engine.core.utils.RandomUtils in project ovirt-engine by oVirt.
the class JsonObjectSerializationEntitiesTest method randomStorageDomainStatic.
private static StorageDomainStatic randomStorageDomainStatic() {
RandomUtils random = RandomUtils.instance();
StorageDomainStatic sds = new StorageDomainStatic();
sds.setId(Guid.newGuid());
sds.setStorage(random.nextString(10));
sds.setStorageType(random.nextEnum(StorageType.class));
sds.setStorageName(random.nextString(10));
sds.setDescription(random.nextString(10));
sds.setWarningLowSpaceIndicator(5);
sds.setCriticalSpaceActionBlocker(10);
return sds;
}
use of org.ovirt.engine.core.utils.RandomUtils in project ovirt-engine by oVirt.
the class JsonObjectSerializationEntitiesTest method randomStoragePool.
private static StoragePool randomStoragePool() {
RandomUtils random = RandomUtils.instance();
StoragePool sp = new StoragePool();
sp.setdescription(random.nextString(10));
sp.setComment(random.nextString(10));
sp.setName(random.nextString(10));
sp.setId(Guid.newGuid());
sp.setIsLocal(random.nextBoolean());
sp.setStatus(random.nextEnum(StoragePoolStatus.class));
return sp;
}
use of org.ovirt.engine.core.utils.RandomUtils in project ovirt-engine by oVirt.
the class JsonObjectSerializationEntitiesTest method randomVdsDynamic.
private static VdsDynamic randomVdsDynamic() {
RandomUtils random = RandomUtils.instance();
VdsDynamic vdsDynamic = new VdsDynamic();
vdsDynamic.setCpuCores(random.nextInt());
vdsDynamic.setCpuThreads(random.nextInt());
vdsDynamic.setCpuModel(random.nextString(10));
vdsDynamic.setCpuSpeedMh(random.nextDouble());
vdsDynamic.setIfTotalSpeed(random.nextString(10));
vdsDynamic.setKvmEnabled(random.nextBoolean());
vdsDynamic.setMemCommited(random.nextInt());
vdsDynamic.setPhysicalMemMb(random.nextInt());
vdsDynamic.setStatus(random.nextEnum(VDSStatus.class));
vdsDynamic.setId(Guid.newGuid());
vdsDynamic.setVmActive(random.nextInt());
vdsDynamic.setVmCount(random.nextInt());
vdsDynamic.setVmMigrating(random.nextInt());
vdsDynamic.setReservedMem(random.nextInt());
vdsDynamic.setGuestOverhead(random.nextInt());
vdsDynamic.setPreviousStatus(random.nextEnum(VDSStatus.class));
vdsDynamic.setSoftwareVersion(random.nextNumericString(5) + '.' + random.nextNumericString(5));
vdsDynamic.setVersionName(random.nextString(10));
vdsDynamic.setPendingVcpusCount(random.nextInt());
vdsDynamic.setPendingVmemSize(random.nextInt());
vdsDynamic.setNetConfigDirty(random.nextBoolean());
vdsDynamic.setTransparentHugePagesState(random.nextEnum(VdsTransparentHugePagesState.class));
vdsDynamic.setHardwareUUID(Guid.newGuid().toString());
vdsDynamic.setHardwareFamily(random.nextString(10));
vdsDynamic.setHardwareSerialNumber(random.nextString(10));
vdsDynamic.setHardwareVersion(random.nextString(10));
vdsDynamic.setHardwareProductName(random.nextString(10));
vdsDynamic.setHardwareManufacturer(random.nextString(10));
return vdsDynamic;
}
use of org.ovirt.engine.core.utils.RandomUtils in project ovirt-engine by oVirt.
the class JsonObjectSerializationEntitiesTest method randomVdsStatistics.
private static VdsStatistics randomVdsStatistics() {
RandomUtils random = RandomUtils.instance();
VdsStatistics vdsStatistics = new VdsStatistics();
vdsStatistics.setCpuIdle(random.nextDouble());
vdsStatistics.setCpuLoad(random.nextDouble());
vdsStatistics.setCpuSys(random.nextDouble());
vdsStatistics.setCpuUser(random.nextDouble());
vdsStatistics.setMemAvailable(random.nextLong());
vdsStatistics.setMemFree(random.nextLong());
vdsStatistics.setMemShared(random.nextLong());
vdsStatistics.setUsageCpuPercent(random.nextInt());
vdsStatistics.setUsageMemPercent(random.nextInt());
vdsStatistics.setUsageNetworkPercent(random.nextInt());
vdsStatistics.setCpuOverCommitTimeStamp(new Date(random.nextLong()));
return vdsStatistics;
}
Aggregations