use of org.graalvm.component.installer.model.ComponentInfo in project graal by oracle.
the class UpgradeTest method testIgnoreUnsatisfiedComponentCommandline.
/**
* Checks "gu upgrade". Should select 1.0.1.0 with ruby 1.0.1.1 since in newer Graals Ruby is
* not available
*/
@Test
public void testIgnoreUnsatisfiedComponentCommandline() throws Exception {
initVersion("1.0.0.0");
ComponentInfo ci = new ComponentInfo("org.graalvm.ruby", "Installed Ruby", "1.0.0.0");
storage.installed.add(ci);
options.put(Commands.OPTION_IGNORE_MISSING_COMPONENTS, "");
UpgradeCommand cmd = new UpgradeCommand();
cmd.init(this, this);
cmd.execute();
Version installedGraalVMVersion = cmd.getProcess().getNewGraalRegistry().getGraalVersion();
assertEquals("1.1.1-0.rc.1", installedGraalVMVersion.originalString());
assertNull("Ruby should not be migrated", cmd.getProcess().getNewGraalRegistry().findComponent("ruby"));
}
use of org.graalvm.component.installer.model.ComponentInfo in project graal by oracle.
the class UpgradeTest method testUpgradeToNewestAvailable.
/**
* Checks "gu upgrade". Should select 1.0.1.0 with ruby 1.0.1.1 since in newer Graals Ruby is
* not available
*/
@Test
public void testUpgradeToNewestAvailable() throws Exception {
initVersion("1.0.0.0");
ComponentInfo ci = new ComponentInfo("org.graalvm.ruby", "Installed Ruby", "1.0.0.0");
storage.installed.add(ci);
UpgradeCommand cmd = new UpgradeCommand();
cmd.init(this, this);
cmd.execute();
Version installedGraalVMVersion = cmd.getProcess().getNewGraalRegistry().getGraalVersion();
Version installedRubyVersion = cmd.getProcess().getNewGraalRegistry().findComponent("ruby").getVersion();
assertEquals("1.0.1.0", installedGraalVMVersion.toString());
assertEquals("1.0.1.1", installedRubyVersion.toString());
}
use of org.graalvm.component.installer.model.ComponentInfo in project graal by oracle.
the class UpgradeTest method testInstallNewWithoutCoreUpgrade.
/**
* Upgrade command is used to install a new component, but the core is most recent one and need
* not to be upgraded. Component must go to the existing install.
*
* @throws Exception
*/
@Test
public void testInstallNewWithoutCoreUpgrade() throws Exception {
initVersion("1.0.1.0");
textParams.add("ruby");
UpgradeCommand cmd = new UpgradeCommand();
cmd.init(this, this);
helper = cmd.getProcess();
ComponentInfo info = cmd.configureProcess();
assertNotNull(info);
// will not install core
assertFalse(helper.installGraalCore(info));
assertNull(helper.getTargetInfo());
// found the current graalvm:
assertEquals(getLocalRegistry().getGraalVersion(), info.getVersion());
List<ComponentParam> toDownload = helper.allComponents();
// no component (e.g. migration) was added, requested ruby is in there
assertEquals(1, toDownload.size());
assertEquals("org.graalvm.ruby", toDownload.get(0).getShortName());
}
use of org.graalvm.component.installer.model.ComponentInfo in project graal by oracle.
the class UpgradeTest method testUpgradeToCompatibleVersionCommandline.
/**
* Tests "gu upgrade 1.0.1" on 1.0.1 installation. 1.0.1 core should be installed with ruby
* 1.0.1.1
*/
@Test
public void testUpgradeToCompatibleVersionCommandline() throws Exception {
initVersion("1.0.0.0");
textParams.add("1.0.1");
ComponentInfo ci = new ComponentInfo("org.graalvm.ruby", "Installed Ruby", "1.0.0.0");
storage.installed.add(ci);
UpgradeCommand cmd = new UpgradeCommand();
cmd.init(this, this);
assertEquals(0, cmd.execute());
ComponentRegistry newReg = cmd.getProcess().getNewGraalRegistry();
ComponentInfo ruby = newReg.findComponent("ruby");
assertEquals("1.0.1.1", ruby.getVersion().toString());
}
use of org.graalvm.component.installer.model.ComponentInfo in project graal by oracle.
the class UpgradeTest method testUpgradeFromDevToSpecificVersion2.
/**
* Checks that upgrade will install graal for the specific Component.
*/
@Test
public void testUpgradeFromDevToSpecificVersion2() throws Exception {
initVersion("1.0.0-dev");
textParams.add("python=1.0.1");
UpgradeCommand cmd = new UpgradeCommand();
cmd.init(this, this);
ComponentInfo graalInfo = cmd.configureProcess();
assertNotNull(graalInfo);
// check that GraalVM appropriate for 1.0.1 component is selected
assertEquals("1.0.1.0", graalInfo.getVersion().toString());
assertEquals(1, cmd.getProcess().addedComponents().size());
ComponentParam p = cmd.getProcess().addedComponents().iterator().next();
ComponentInfo ci = p.createMetaLoader().getComponentInfo();
// check that component 1.0.1 will be installed
assertEquals("1.0.1.0", ci.getVersion().toString());
}
Aggregations