use of org.graalvm.component.installer.FileIterable in project graal by oracle.
the class CatalogInstallTest method testInstallDependencyFromSameDirectory.
/**
* Checks that dependencies can be loaded from the same directory as the installed Component.
*/
@Test
public void testInstallDependencyFromSameDirectory() throws Exception {
Path ruby193Source = dataFile("../repo/19.3.0.0/r");
Path llvm193Source = dataFile("../repo/19.3.0.0/llvm-toolchain");
// they should be next to eah other
assertEquals(ruby193Source.getParent(), llvm193Source.getParent());
files.add(ruby193Source.toFile());
setupVersion("19.3.0.0");
// no external catalog
downloader = new RemoteCatalogDownloader(this, this, (URL) null);
downloader.addLocalChannelSource(new SoftwareChannelSource(ruby193Source.getParent().toFile().toURI().toString()));
catalogFactory = new CatalogFactory() {
@Override
public ComponentCatalog createComponentCatalog(CommandInput input) {
return new CatalogContents(CatalogInstallTest.this, downloader.getStorage(), input.getLocalRegistry());
}
@Override
public List<GraalEdition> listEditions(ComponentRegistry targetGraalVM) {
return Collections.emptyList();
}
};
FileIterable fit = new FileIterable(this, this);
fit.setCatalogFactory(catalogFactory);
paramIterable = fit;
InstallCommand cmd = new InstallCommand();
cmd.init(this, withBundle(InstallCommand.class));
cmd.executionInit();
cmd.executeStep(cmd::prepareInstallation, false);
assertFalse(cmd.getDependencies().isEmpty());
}
Aggregations