Search in sources :

Example 1 with Upgrade490to4910

use of com.cloud.upgrade.dao.Upgrade490to4910 in project cloudstack by apache.

the class DatabaseUpgradeCheckerTest method testCalculateUpgradePath490to4910.

@Test
public void testCalculateUpgradePath490to4910() {
    final CloudStackVersion dbVersion = CloudStackVersion.parse("4.9.0");
    assertNotNull(dbVersion);
    final CloudStackVersion currentVersion = CloudStackVersion.parse("4.9.1.0");
    assertNotNull(currentVersion);
    final DatabaseUpgradeChecker checker = new DatabaseUpgradeChecker();
    final DbUpgrade[] upgrades = checker.calculateUpgradePath(dbVersion, currentVersion);
    assertNotNull(upgrades);
    assertTrue(upgrades.length >= 1);
    assertTrue(upgrades[0] instanceof Upgrade490to4910);
    assertTrue(Arrays.equals(new String[] { "4.9.0", currentVersion.toString() }, upgrades[0].getUpgradableVersionRange()));
    assertEquals(currentVersion.toString(), upgrades[0].getUpgradedVersion());
}
Also used : Upgrade490to4910(com.cloud.upgrade.dao.Upgrade490to4910) CloudStackVersion(org.apache.cloudstack.utils.CloudStackVersion) DbUpgrade(com.cloud.upgrade.dao.DbUpgrade) Test(org.junit.Test)

Aggregations

DbUpgrade (com.cloud.upgrade.dao.DbUpgrade)1 Upgrade490to4910 (com.cloud.upgrade.dao.Upgrade490to4910)1 CloudStackVersion (org.apache.cloudstack.utils.CloudStackVersion)1 Test (org.junit.Test)1