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");
}
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");
}
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);
}
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;
}
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;
}
Aggregations