Search in sources :

Example 66 with ComponentInfo

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

the class RemoteStorageTest method testInvalidRemoteURL.

@Test
public void testInvalidRemoteURL() throws Exception {
    loadCatalog("catalog.bad1.properties");
    // load good compoennt:
    ComponentInfo rInfo = loadLastComponent("ruby");
    assertEquals("ruby", rInfo.getId());
    // and now bad component
    exception.expect(MalformedURLException.class);
    rInfo = loadLastComponent("r");
}
Also used : ComponentInfo(org.graalvm.component.installer.model.ComponentInfo) Test(org.junit.Test)

Example 67 with ComponentInfo

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

the class RemoteStorageTest method testLoadMetadataMalformed.

@Test
public void testLoadMetadataMalformed() throws Exception {
    loadCatalog("catalog.bad2.properties");
    // load good compoennt:
    ComponentInfo rInfo = loadLastComponent("r");
    assertEquals("R", rInfo.getId());
    // and now bad component
    exception.expect(MetadataException.class);
    exception.expectMessage("ERROR_InvalidVersion");
    rInfo = loadLastComponent("ruby");
}
Also used : ComponentInfo(org.graalvm.component.installer.model.ComponentInfo) Test(org.junit.Test)

Example 68 with ComponentInfo

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

the class RemoteStorageTest method assertComponentHasNormalizedValues.

private void assertComponentHasNormalizedValues(String cid) throws IOException {
    Set<ComponentInfo> infos = remStorage.loadComponentMetadata(cid);
    assertEquals(1, infos.size());
    ComponentInfo ci = infos.iterator().next();
    String os = ci.getRequiredGraalValues().get(CommonConstants.CAP_OS_NAME);
    String arch = ci.getRequiredGraalValues().get(CommonConstants.CAP_OS_ARCH);
    String nos = SystemUtils.normalizeOSName(os, arch);
    String narch = SystemUtils.normalizeArchitecture(os, arch);
    assertEquals(nos, os);
    assertEquals(narch, arch);
}
Also used : ComponentInfo(org.graalvm.component.installer.model.ComponentInfo)

Example 69 with ComponentInfo

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

the class Installer method validateAll.

/**
 * Validates requirements, decides whether to install. Returns false if the component should be
 * skipped.
 *
 * @return true, if the component should be installed
 * @throws IOException
 */
@Override
public boolean validateAll() throws IOException {
    Verifier veri = validateRequirements();
    ComponentInfo existing = registry.findComponent(componentInfo.getId());
    if (existing != null) {
        if (!veri.shouldInstall(componentInfo)) {
            return false;
        }
    }
    validateFiles();
    validateSymlinks();
    return true;
}
Also used : ComponentInfo(org.graalvm.component.installer.model.ComponentInfo) Verifier(org.graalvm.component.installer.model.Verifier)

Example 70 with ComponentInfo

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

the class LicensePresenter method formatComponentList.

String formatComponentList(String licId) {
    List<MetadataLoader> loaders = licensesToAccept.get(licId);
    String list = null;
    for (MetadataLoader l : loaders) {
        ComponentInfo ci = l.getComponentInfo();
        if (list == null) {
            list = feedback.l10n("INSTALL_LicenseComponentStart", ci.getName());
        } else {
            list = feedback.l10n("INSTALL_LicenseComponentCont", list, ci.getName());
        }
    }
    return list;
}
Also used : MetadataLoader(org.graalvm.component.installer.persist.MetadataLoader) ComponentInfo(org.graalvm.component.installer.model.ComponentInfo)

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