use of org.graalvm.component.installer.model.CatalogContents in project graal by oracle.
the class RemoteCatalogDownloaderTest method openCatalog.
ComponentCatalog openCatalog(SoftwareChannel ch, Version v) throws IOException {
ComponentCatalog cc = new CatalogContents(this, ch.getStorage(), getLocalRegistry(), v);
cc.getComponentIDs();
return cc;
}
use of org.graalvm.component.installer.model.CatalogContents in project graal by oracle.
the class RemoteCatalogDownloader method getRegistry.
public ComponentCollection getRegistry() {
if (union == null) {
union = new CatalogContents(feedback, mergeChannels(), input.getLocalRegistry());
// get errors early
union.getComponentIDs();
}
return union;
}
use of org.graalvm.component.installer.model.CatalogContents in project graal by oracle.
the class ListTest method initRemoteStorage.
private void initRemoteStorage() throws MalformedURLException {
this.remoteStorage = new RemotePropertiesStorage(this, getLocalRegistry(), catalogContents, "linux_amd64", Version.fromString("1.0.0-rc3-dev"), new URL("http://go.to/graalvm"));
this.registry = new CatalogContents(this, remoteStorage, localRegistry);
}
use of org.graalvm.component.installer.model.CatalogContents in project graal by oracle.
the class ListTest method assert110Components.
private void assert110Components(Version v, Version min) throws Exception {
Path p = dataFile("../repo/catalog.properties");
try (InputStream is = new FileInputStream(p.toFile())) {
catalogContents.load(is);
}
this.remoteStorage = new RemotePropertiesStorage(this, getLocalRegistry(), catalogContents, "linux_amd64", v, new URL("http://go.to/graalvm"));
this.registry = new CatalogContents(this, remoteStorage, localRegistry);
AvailableCommand inst = new AvailableCommand() {
@Override
boolean process() {
super.process();
// block the actual print
return false;
}
};
textParams.add("r");
textParams.add("ruby");
textParams.add("python");
inst.init(this, this.withBundle(ListInstalledCommand.class));
inst.execute();
Set<String> found = new HashSet<>();
for (ComponentInfo ci : inst.getComponents()) {
if (ci.getId().equals(BundleConstants.GRAAL_COMPONENT_ID)) {
continue;
}
assertTrue(found.add(ci.getId().toLowerCase()));
assertTrue(min.compareTo(ci.getVersion()) <= 0);
}
// ruby not present
assertFalse(found.contains("org.graalvm.ruby"));
assertTrue(found.contains("org.graalvm.r"));
assertTrue(found.contains("org.graalvm.python"));
}
use of org.graalvm.component.installer.model.CatalogContents in project graal by oracle.
the class UpgradeTest method testUpgradeWithDependencies.
/**
* Upgrade an installation with "ruby" to a newer one, where "ruby" has a dependency on an
* additional component. The other component should be auto-installed.
*/
@Test
public void testUpgradeWithDependencies() throws Exception {
initVersion("1.0.0.0", "../repo/catalog-19.3.properties");
ComponentInfo ci = new ComponentInfo("org.graalvm.r", "Installed R", "1.0.0.0");
storage.installed.add(ci);
UpgradeCommand cmd = new UpgradeCommand();
cmd.init(this, this);
textParams.add("r");
ComponentInfo graalInfo = cmd.configureProcess();
assertNotNull(graalInfo);
assertEquals(Version.fromString("19.3.0.0"), graalInfo.getVersion());
boolean installed = cmd.getProcess().installGraalCore(graalInfo);
assertTrue(installed);
factory = new CatalogFactory() {
@Override
public ComponentCatalog createComponentCatalog(CommandInput in) {
RemoteCatalogDownloader dnl = new RemoteCatalogDownloader(in, UpgradeTest.this, downloader.getOverrideCatalogSpec());
// carry over the override spec
return new CatalogContents(UpgradeTest.this, dnl.getStorage(), in.getLocalRegistry());
}
@Override
public List<GraalEdition> listEditions(ComponentRegistry targetGraalVM) {
return Collections.emptyList();
}
};
InstallTrampoline targetInstall = new InstallTrampoline();
cmd.getProcess().configureInstallCommand(targetInstall);
targetInstall.executionInit();
targetInstall.prepareInstallation();
assertTrue(targetInstall.getUnresolvedDependencies().isEmpty());
List<ComponentParam> deps = targetInstall.getDependencies();
assertEquals(1, deps.size());
MetadataLoader ldr = deps.iterator().next().createFileLoader();
assertEquals("org.graalvm.llvm-toolchain", ldr.getComponentInfo().getId());
}
Aggregations