use of org.ovirt.engine.core.compat.Version in project ovirt-engine by oVirt.
the class NetworkFilterDaoTest method testGetAllSupportedNetworkFiltersByVersionFirstVersion.
@Test
public void testGetAllSupportedNetworkFiltersByVersionFirstVersion() {
final Version version = new Version("3.0");
assertFirstVersionOnly(version);
}
use of org.ovirt.engine.core.compat.Version in project ovirt-engine by oVirt.
the class BackendDataCenterResourceTest method getVersions.
protected List<Version> getVersions() {
Version version = mock(Version.class);
when(version.getMajor()).thenReturn(2);
when(version.getMinor()).thenReturn(3);
List<Version> versions = new ArrayList<>();
versions.add(version);
return versions;
}
use of org.ovirt.engine.core.compat.Version in project ovirt-engine by oVirt.
the class BackendApiResourceTest method setUpGetSystemVersionExpectations.
protected void setUpGetSystemVersionExpectations() {
QueryReturnValue productRpmQueryResult = new QueryReturnValue();
productRpmQueryResult.setSucceeded(true);
productRpmQueryResult.setReturnValue(SYSTEM_VERSION);
when(backend.runQuery(eq(QueryType.GetConfigurationValue), getProductRPMVersionParams())).thenReturn(productRpmQueryResult);
QueryReturnValue productVersionQueryResult = new QueryReturnValue();
productVersionQueryResult.setSucceeded(true);
productVersionQueryResult.setReturnValue(new Version(MAJOR, MINOR, BUILD, REVISION));
when(backend.runQuery(eq(QueryType.GetProductVersion), getProductVersionParams())).thenReturn(productVersionQueryResult);
}
use of org.ovirt.engine.core.compat.Version in project ovirt-engine by oVirt.
the class UpdateClusterCommandTest method vmsAreUpdatedByTheOrderOfTheirIds.
@Test
public void vmsAreUpdatedByTheOrderOfTheirIds() {
final Cluster newerCluster = createDefaultCluster();
newerCluster.setCompatibilityVersion(new Version(1, 2));
createCommand(newerCluster);
cmd.init();
VmStatic vm1 = new VmStatic();
vm1.setId(VM_ID1);
VmStatic vm2 = new VmStatic();
vm2.setId(VM_ID2);
VmStatic vm3 = new VmStatic();
vm3.setId(VM_ID3);
when(vmStaticDao.getAllByCluster(any())).thenReturn(Arrays.asList(vm1, vm2, vm3));
// the VMs ordered by Guids: v2, v3, v1
assertEquals(Arrays.asList(vm2, vm3, vm1), cmd.filterVmsInClusterNeedUpdate());
}
use of org.ovirt.engine.core.compat.Version in project ovirt-engine by oVirt.
the class VersionStorageFormatUtilTest method versionHasMatchingFormat.
@Theory
public void versionHasMatchingFormat(Version v) {
StorageFormatType sft = VersionStorageFormatUtil.getForVersion(v);
assertNotNull(String.format("Missing format for version %s", v), sft);
Version earliestSupported = VersionStorageFormatUtil.getEarliestVersionSupported(sft);
assertNotNull(String.format("Missing earliest version for format %s", sft), earliestSupported);
assertTrue(String.format("Earliest supported version (%s) should no be later than the version requiring this type (%s)", earliestSupported, v), v.compareTo(earliestSupported) >= 0);
}
Aggregations