Search in sources :

Example 16 with ComponentInfo

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

the class InstallVersionsTest method testInstallNewUpdatedComponent.

/**
 * Installs a new component, but updated one, from a newer distribution.
 */
@Test
public void testInstallNewUpdatedComponent() throws Exception {
    initVersion("1.0.1.0");
    textParams.add("ruby");
    cmd.prepareInstallation();
    assertEquals(1, installInfos.size());
    ComponentInfo ci = installInfos.get(0);
    assertEquals("1.0.1.1", ci.getVersion().toString());
}
Also used : ComponentInfo(org.graalvm.component.installer.model.ComponentInfo) Test(org.junit.Test)

Example 17 with ComponentInfo

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

the class InstallVersionsTest method testMissingComponent.

/**
 * Installs a missing component from the same distribution.
 */
@Test
public void testMissingComponent() throws Exception {
    initVersion("1.0.1.0");
    textParams.add("python");
    cmd.prepareInstallation();
    assertEquals(1, installInfos.size());
    ComponentInfo ci = installInfos.get(0);
    assertEquals("1.0.1.0", ci.getVersion().toString());
}
Also used : ComponentInfo(org.graalvm.component.installer.model.ComponentInfo) Test(org.junit.Test)

Example 18 with ComponentInfo

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

the class InstallVersionsTest method overrideCreateInstaller.

@SuppressWarnings("unused")
protected Installer overrideCreateInstaller(ComponentParam p, MetadataLoader ldr) throws IOException {
    ComponentInfo partialInfo;
    partialInfo = ldr.getComponentInfo();
    ldr.loadPaths();
    Archive a = null;
    Installer inst = new Installer(this, getFileOperations(), partialInfo, getLocalRegistry(), getRegistry(), a);
    inst.setPermissions(ldr.loadPermissions());
    inst.setSymlinks(ldr.loadSymlinks());
    return inst;
}
Also used : Archive(org.graalvm.component.installer.Archive) ComponentInfo(org.graalvm.component.installer.model.ComponentInfo)

Example 19 with ComponentInfo

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

the class InstallTest method testFailOnExistingFromCatalog.

@Test
public void testFailOnExistingFromCatalog() throws Exception {
    ComponentInfo fakeInfo = new ComponentInfo("ruby", "Fake ruby", "1.0");
    storage.installed.add(fakeInfo);
    URL u = new URL("test://graalvm.io/download/catalog");
    URL u2 = new URL(u, "graalvm-ruby.zip");
    Handler.bind(u.toString(), getClass().getResource("catalog"));
    storage.graalInfo.put(CommonConstants.CAP_GRAALVM_VERSION, "0.33-dev");
    initCatalogIterable(u);
    textParams.add("ruby");
    options.put(Commands.OPTION_FAIL_EXISTING, "");
    files.clear();
    inst = new InstallCommand();
    inst.init(this, withBundle(InstallCommand.class));
    try {
        inst.execute();
    } catch (DependencyException.Conflict ex) {
        assertEquals("VERIFY_ComponentExists", ex.getMessage());
    }
    assertFalse(Handler.isVisited(u2));
}
Also used : ComponentInfo(org.graalvm.component.installer.model.ComponentInfo) DependencyException(org.graalvm.component.installer.DependencyException) URL(java.net.URL) Test(org.junit.Test)

Example 20 with ComponentInfo

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

the class InstallTest method testInstallMissingComponent.

/**
 * Installs an a missing component from the same distribution.
 *
 * @throws Exception
 */
@Test
public void testInstallMissingComponent() throws Exception {
    ComponentInfo fakeInfo = new ComponentInfo("ruby", "Fake ruby", "1.0");
    storage.installed.add(fakeInfo);
}
Also used : ComponentInfo(org.graalvm.component.installer.model.ComponentInfo) Test(org.junit.Test)

Aggregations

ComponentInfo (org.graalvm.component.installer.model.ComponentInfo)149 Test (org.junit.Test)94 Path (java.nio.file.Path)36 Version (org.graalvm.component.installer.Version)28 HashSet (java.util.HashSet)20 ArrayList (java.util.ArrayList)19 ComponentParam (org.graalvm.component.installer.ComponentParam)19 IOException (java.io.IOException)13 URL (java.net.URL)11 MetadataLoader (org.graalvm.component.installer.persist.MetadataLoader)10 InputStream (java.io.InputStream)9 HashMap (java.util.HashMap)9 Collection (java.util.Collection)8 List (java.util.List)8 Properties (java.util.Properties)8 Map (java.util.Map)7 Set (java.util.Set)7 Collections (java.util.Collections)6 FailedOperationException (org.graalvm.component.installer.FailedOperationException)6 SystemUtils (org.graalvm.component.installer.SystemUtils)6