use of org.graalvm.component.installer.FailedOperationException in project graal by oracle.
the class RemoteCatalogDownloaderTest method testSingleNonMatchingCatalogIgnored.
/**
* Checks that if a single catalog does not correspond to graalvm version, other catalogs will
* be read.
*
* @throws Exception
*/
@Test
public void testSingleNonMatchingCatalogIgnored() throws Exception {
setupJoinedCatalog("catalogMultiPart1.properties");
ComponentCatalog col = openCatalog(rcd);
// need to incorporate requirements, too... they are tested in CatalogIterable
CatalogIterable catIt = new CatalogIterable(this, this);
catIt.setRemoteRegistry(col);
textParams.add("r");
textParams.add("ruby");
textParams.add("python");
Iterator<ComponentParam> iter = catIt.iterator();
ComponentParam p = iter.next();
ComponentInfo info;
assertNotNull(p);
info = p.createMetaLoader().getComponentInfo();
assertEquals("1.0.0.0", info.getVersion().toString());
p = iter.next();
assertNotNull(p);
info = p.createMetaLoader().getComponentInfo();
assertEquals("1.0.0.0", info.getVersion().toString());
// python cannot be found, an exception expected
assertTrue(iter.hasNext());
try {
p = iter.next();
fail("No python for 1.0.0");
} catch (FailedOperationException ex) {
}
}
use of org.graalvm.component.installer.FailedOperationException in project graal by oracle.
the class InstallTest method testFailInstallCleanup.
@Test
public void testFailInstallCleanup() throws IOException {
Path offending = targetPath.resolve(SystemUtils.fromCommonString("jre/bin/ruby"));
Files.createDirectories(offending.getParent());
Files.createFile(offending);
inst = new InstallCommand();
inst.init(this, withBundle(InstallCommand.class));
try {
inst.execute();
fail("Exception expected");
} catch (IOException | FailedOperationException ex) {
// OK
}
Files.delete(offending);
// jre/bin
Files.delete(offending.getParent());
// jre
Files.delete(offending.getParent().getParent());
assertFalse(Files.list(targetPath).findFirst().isPresent());
}
Aggregations