use of org.graalvm.component.installer.model.ComponentInfo in project graal by oracle.
the class InstallVersionsTest method testInstallNewUpdatedComponent.
/**
* Installs a new component, but updated one, from a newer distribution.
*/
@Test
public void testInstallNewUpdatedComponent() throws Exception {
initVersion("1.0.1.0");
textParams.add("ruby");
cmd.prepareInstallation();
assertEquals(1, installInfos.size());
ComponentInfo ci = installInfos.get(0);
assertEquals("1.0.1.1", ci.getVersion().toString());
}
use of org.graalvm.component.installer.model.ComponentInfo in project graal by oracle.
the class InstallVersionsTest method testMissingComponent.
/**
* Installs a missing component from the same distribution.
*/
@Test
public void testMissingComponent() throws Exception {
initVersion("1.0.1.0");
textParams.add("python");
cmd.prepareInstallation();
assertEquals(1, installInfos.size());
ComponentInfo ci = installInfos.get(0);
assertEquals("1.0.1.0", ci.getVersion().toString());
}
use of org.graalvm.component.installer.model.ComponentInfo in project graal by oracle.
the class InstallVersionsTest method overrideCreateInstaller.
@SuppressWarnings("unused")
protected Installer overrideCreateInstaller(ComponentParam p, MetadataLoader ldr) throws IOException {
ComponentInfo partialInfo;
partialInfo = ldr.getComponentInfo();
ldr.loadPaths();
Archive a = null;
Installer inst = new Installer(this, getFileOperations(), partialInfo, getLocalRegistry(), getRegistry(), a);
inst.setPermissions(ldr.loadPermissions());
inst.setSymlinks(ldr.loadSymlinks());
return inst;
}
use of org.graalvm.component.installer.model.ComponentInfo in project graal by oracle.
the class InstallTest method testFailOnExistingFromCatalog.
@Test
public void testFailOnExistingFromCatalog() throws Exception {
ComponentInfo fakeInfo = new ComponentInfo("ruby", "Fake ruby", "1.0");
storage.installed.add(fakeInfo);
URL u = new URL("test://graalvm.io/download/catalog");
URL u2 = new URL(u, "graalvm-ruby.zip");
Handler.bind(u.toString(), getClass().getResource("catalog"));
storage.graalInfo.put(CommonConstants.CAP_GRAALVM_VERSION, "0.33-dev");
initCatalogIterable(u);
textParams.add("ruby");
options.put(Commands.OPTION_FAIL_EXISTING, "");
files.clear();
inst = new InstallCommand();
inst.init(this, withBundle(InstallCommand.class));
try {
inst.execute();
} catch (DependencyException.Conflict ex) {
assertEquals("VERIFY_ComponentExists", ex.getMessage());
}
assertFalse(Handler.isVisited(u2));
}
use of org.graalvm.component.installer.model.ComponentInfo in project graal by oracle.
the class InstallTest method testInstallMissingComponent.
/**
* Installs an a missing component from the same distribution.
*
* @throws Exception
*/
@Test
public void testInstallMissingComponent() throws Exception {
ComponentInfo fakeInfo = new ComponentInfo("ruby", "Fake ruby", "1.0");
storage.installed.add(fakeInfo);
}
Aggregations