Search in sources :

Example 6 with Version

use of org.ovirt.engine.api.model.Version in project ovirt-engine by oVirt.

the class VersionMapperTest method assertBuild.

/**
 * Asserts that the build version number extracted from the given version text is the expected.
 *
 * @param expected the expected build version number
 * @param text the complete version string
 */
private void assertBuild(Integer expected, String text) {
    Version version = VersionMapper.fromVersionString(text);
    assertNotNull(version);
    Integer actual = version.getBuild();
    assertEquals("Incorrect build version number", expected, actual);
}
Also used : Version(org.ovirt.engine.api.model.Version)

Example 7 with Version

use of org.ovirt.engine.api.model.Version in project ovirt-engine by oVirt.

the class VersionMapperTest method assertMinor.

/**
 * Asserts that the minor version number extracted from the given version text is the expected.
 *
 * @param expected the expected minor version number
 * @param text the complete version string
 */
private void assertMinor(Integer expected, String text) {
    Version version = VersionMapper.fromVersionString(text);
    assertNotNull(version);
    Integer actual = version.getMinor();
    assertEquals("Incorrect minor version number", expected, actual);
}
Also used : Version(org.ovirt.engine.api.model.Version)

Example 8 with Version

use of org.ovirt.engine.api.model.Version in project ovirt-engine by oVirt.

the class VersionMapperTest method testEmptyStringProducesEmptyVersion.

/**
 * Checks that an empty version string results in a version object, containing an empty string in the
 * {@code full_version} attribute.
 */
@Test
public void testEmptyStringProducesEmptyVersion() {
    Version version = VersionMapper.fromVersionString("");
    assertNotNull(version);
    assertEquals("", version.getFullVersion());
}
Also used : Version(org.ovirt.engine.api.model.Version) Test(org.junit.Test)

Example 9 with Version

use of org.ovirt.engine.api.model.Version in project ovirt-engine by oVirt.

the class VersionMapperTest method assertRevision.

/**
 * Asserts that the revision version number extracted from the given version text is the expected.
 *
 * @param expected the expected revision version number
 * @param text the complete version string
 */
private void assertRevision(Integer expected, String text) {
    Version version = VersionMapper.fromVersionString(text);
    assertNotNull(version);
    Integer actual = version.getRevision();
    assertEquals("Incorrect revision version number", expected, actual);
}
Also used : Version(org.ovirt.engine.api.model.Version)

Example 10 with Version

use of org.ovirt.engine.api.model.Version in project ovirt-engine by oVirt.

the class VersionMapperTest method assertMajor.

/**
 * Asserts that the major version number extracted from the given version text is the expected.
 *
 * @param expected the expected major version number
 * @param text the complete version string
 */
private void assertMajor(Integer expected, String text) {
    Version version = VersionMapper.fromVersionString(text);
    assertNotNull(version);
    Integer actual = version.getMajor();
    assertEquals("Incorrect major version number", expected, actual);
}
Also used : Version(org.ovirt.engine.api.model.Version)

Aggregations

Version (org.ovirt.engine.api.model.Version)20 Test (org.junit.Test)5 Response (javax.ws.rs.core.Response)2 V3Version (org.ovirt.engine.api.v3.types.V3Version)2 StoragePool (org.ovirt.engine.core.common.businessentities.StoragePool)2 BigDecimal (java.math.BigDecimal)1 Matcher (java.util.regex.Matcher)1 Certificate (org.ovirt.engine.api.model.Certificate)1 Cluster (org.ovirt.engine.api.model.Cluster)1 Cpu (org.ovirt.engine.api.model.Cpu)1 CpuTopology (org.ovirt.engine.api.model.CpuTopology)1 Display (org.ovirt.engine.api.model.Display)1 ExternalHostProvider (org.ovirt.engine.api.model.ExternalHostProvider)1 ExternalStatus (org.ovirt.engine.api.model.ExternalStatus)1 HardwareInformation (org.ovirt.engine.api.model.HardwareInformation)1 Host (org.ovirt.engine.api.model.Host)1 HostDevicePassthrough (org.ovirt.engine.api.model.HostDevicePassthrough)1 HostStatus (org.ovirt.engine.api.model.HostStatus)1 HostType (org.ovirt.engine.api.model.HostType)1 IscsiDetails (org.ovirt.engine.api.model.IscsiDetails)1