use of org.graalvm.component.installer.remote.RemotePropertiesStorage 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"));
}
Aggregations