use of org.graalvm.component.installer.Version in project graal by oracle.
the class ListTest method testListSpecifiedNewerComponents.
/**
* Tests that 'list' will print components but just those newer than us.
*/
@Test
public void testListSpecifiedNewerComponents() throws Exception {
Version v = Version.fromString("1.1.0");
storage.graalInfo.put(BundleConstants.GRAAL_VERSION, v.originalString());
assert110Components(v, v);
}
use of org.graalvm.component.installer.Version in project graal by oracle.
the class DirectoryStorageTest method testLoadProvidedCapabilities.
@Test
public void testLoadProvidedCapabilities() throws Exception {
Path p = dataFile("data/core1.component");
ComponentInfo info;
try (InputStream is = Files.newInputStream(p)) {
info = storage.loadMetadataFrom(is);
}
assertEquals("org.graalvm", info.getId());
assertEquals(Version.fromString("1.0.1.0"), info.getProvidedValue("version", Version.class));
assertEquals("ee", info.getProvidedValue("edition", String.class));
}
use of org.graalvm.component.installer.Version in project graal by oracle.
the class UpgradeTest method initVersion.
private Version initVersion(String s, String catalogResource) throws IOException {
Version v = Version.fromString(s);
storage.graalInfo.put(BundleConstants.GRAAL_VERSION, s);
Path catalogPath = dataFile(catalogResource);
downloader = new RemoteCatalogDownloader(this, this, catalogPath.toUri().toURL());
registry = new CatalogContents(this, downloader.getStorage(), localRegistry);
paramIterable = new CatalogIterable(this, this);
helper = new UpgradeProcess(this, this, registry);
return v;
}
use of org.graalvm.component.installer.Version in project graal by oracle.
the class UpgradeTest method testIgnoreUnsatisfiedComponentCommandline.
/**
* Checks "gu upgrade". Should select 1.0.1.0 with ruby 1.0.1.1 since in newer Graals Ruby is
* not available
*/
@Test
public void testIgnoreUnsatisfiedComponentCommandline() throws Exception {
initVersion("1.0.0.0");
ComponentInfo ci = new ComponentInfo("org.graalvm.ruby", "Installed Ruby", "1.0.0.0");
storage.installed.add(ci);
options.put(Commands.OPTION_IGNORE_MISSING_COMPONENTS, "");
UpgradeCommand cmd = new UpgradeCommand();
cmd.init(this, this);
cmd.execute();
Version installedGraalVMVersion = cmd.getProcess().getNewGraalRegistry().getGraalVersion();
assertEquals("1.1.1-0.rc.1", installedGraalVMVersion.originalString());
assertNull("Ruby should not be migrated", cmd.getProcess().getNewGraalRegistry().findComponent("ruby"));
}
use of org.graalvm.component.installer.Version in project graal by oracle.
the class UpgradeTest method testUpgradeToNewestAvailable.
/**
* Checks "gu upgrade". Should select 1.0.1.0 with ruby 1.0.1.1 since in newer Graals Ruby is
* not available
*/
@Test
public void testUpgradeToNewestAvailable() throws Exception {
initVersion("1.0.0.0");
ComponentInfo ci = new ComponentInfo("org.graalvm.ruby", "Installed Ruby", "1.0.0.0");
storage.installed.add(ci);
UpgradeCommand cmd = new UpgradeCommand();
cmd.init(this, this);
cmd.execute();
Version installedGraalVMVersion = cmd.getProcess().getNewGraalRegistry().getGraalVersion();
Version installedRubyVersion = cmd.getProcess().getNewGraalRegistry().findComponent("ruby").getVersion();
assertEquals("1.0.1.0", installedGraalVMVersion.toString());
assertEquals("1.0.1.1", installedRubyVersion.toString());
}
Aggregations