Search in sources :

Example 21 with ComponentParam

use of org.graalvm.component.installer.ComponentParam in project graal by oracle.

the class UpgradeTest method testUpgradeToSameVersion.

/**
 * Checks that upgrade will install graal for the specific Component.
 */
@Test
public void testUpgradeToSameVersion() throws Exception {
    initVersion("1.0.0-dev");
    textParams.add("1.0.0-dev");
    textParams.add("python");
    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.0-dev", graalInfo.getVersion().displayString());
    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.0-dev", ci.getVersion().displayString());
}
Also used : ComponentParam(org.graalvm.component.installer.ComponentParam) ComponentInfo(org.graalvm.component.installer.model.ComponentInfo) Test(org.junit.Test)

Example 22 with ComponentParam

use of org.graalvm.component.installer.ComponentParam in project graal by oracle.

the class UpgradeTest method testUpgradeFromDevToSpecificVersion.

/**
 * Checks that upgrade will install graal of the specified version.
 */
@Test
public void testUpgradeFromDevToSpecificVersion() throws Exception {
    initVersion("1.0.0-dev");
    textParams.add("1.0.1");
    textParams.add("python");
    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());
}
Also used : ComponentParam(org.graalvm.component.installer.ComponentParam) ComponentInfo(org.graalvm.component.installer.model.ComponentInfo) Test(org.junit.Test)

Example 23 with ComponentParam

use of org.graalvm.component.installer.ComponentParam in project graal by oracle.

the class CatalogInstallTest method testInstallWithIgnoredDeps.

@Test
public void testInstallWithIgnoredDeps() throws Exception {
    setupVersion("19.3-dev");
    setupCatalog(null);
    paramIterable = new CatalogIterable(this, this);
    textParams.add("r");
    options.put(Commands.OPTION_NO_DEPENDENCIES, "");
    InstallCommand cmd = new InstallCommand();
    cmd.init(this, withBundle(InstallCommand.class));
    cmd.executionInit();
    cmd.executeStep(cmd::prepareInstallation, false);
    List<ComponentParam> deps = cmd.getDependencies();
    assertTrue(deps.isEmpty());
}
Also used : ComponentParam(org.graalvm.component.installer.ComponentParam) CatalogIterable(org.graalvm.component.installer.remote.CatalogIterable) Test(org.junit.Test)

Example 24 with ComponentParam

use of org.graalvm.component.installer.ComponentParam in project graal by oracle.

the class CatalogInstallTest method testInstallWithDepsSingleLevel.

@Test
public void testInstallWithDepsSingleLevel() throws Exception {
    setupVersion("19.3-dev");
    setupCatalog(null);
    paramIterable = new CatalogIterable(this, this);
    textParams.add("r");
    InstallCommand cmd = new InstallCommand();
    cmd.init(this, withBundle(InstallCommand.class));
    cmd.executionInit();
    cmd.executeStep(cmd::prepareInstallation, false);
    List<ComponentParam> deps = cmd.getDependencies();
    assertEquals(1, deps.size());
    assertEquals("org.graalvm.llvm-toolchain", deps.get(0).createMetaLoader().getComponentInfo().getId());
}
Also used : ComponentParam(org.graalvm.component.installer.ComponentParam) CatalogIterable(org.graalvm.component.installer.remote.CatalogIterable) Test(org.junit.Test)

Aggregations

ComponentParam (org.graalvm.component.installer.ComponentParam)24 ComponentInfo (org.graalvm.component.installer.model.ComponentInfo)19 Test (org.junit.Test)11 MetadataLoader (org.graalvm.component.installer.persist.MetadataLoader)6 CatalogIterable (org.graalvm.component.installer.remote.CatalogIterable)5 ComponentInstaller (org.graalvm.component.installer.ComponentInstaller)4 Version (org.graalvm.component.installer.Version)4 ArrayList (java.util.ArrayList)3 IOException (java.io.IOException)2 URL (java.net.URL)2 HashMap (java.util.HashMap)2 HashSet (java.util.HashSet)2 LinkedHashMap (java.util.LinkedHashMap)2 List (java.util.List)2 Map (java.util.Map)2 Archive (org.graalvm.component.installer.Archive)2 CommandInput (org.graalvm.component.installer.CommandInput)2 ComponentCatalog (org.graalvm.component.installer.ComponentCatalog)2 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 Path (java.nio.file.Path)1