use of org.graalvm.component.installer.model.ComponentInfo in project graal by oracle.
the class InstallTest method testSkipExistingFromCatalog.
@Test
public void testSkipExistingFromCatalog() 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"));
Handler.bind(u2.toString(), getClass().getResource("graalvm-ruby.zip"));
storage.graalInfo.put(CommonConstants.CAP_GRAALVM_VERSION, "0.33-dev");
initCatalogIterable(u);
textParams.add("ruby");
files.clear();
inst = new InstallCommand();
inst.init(this, withBundle(InstallCommand.class));
try {
inst.execute();
} catch (DependencyException.Conflict ex) {
fail("Should not raise an error");
}
assertFalse("Should not touch the remote file", Handler.isVisited(u2));
}
use of org.graalvm.component.installer.model.ComponentInfo in project graal by oracle.
the class DownloadURLIterableTest method testURLParameter.
@Test
public void testURLParameter() throws Exception {
initURLComponent("persist/data/truffleruby3.jar", "test://graalvm.io/download/truffleruby.zip");
this.textParams.add("test://graalvm.io/download/truffleruby.zip");
DownloadURLIterable iterable = new DownloadURLIterable(this, this);
Iterator<ComponentParam> it = iterable.iterator();
assertTrue(it.hasNext());
ComponentParam p = it.next();
assertEquals("test://graalvm.io/download/truffleruby.zip", p.getSpecification());
MetadataLoader ldr = p.createMetaLoader();
assertFalse(p.isComplete());
ComponentInfo ci = ldr.getComponentInfo();
assertTrue(p.isComplete());
assertEquals("ruby", ci.getId());
assertEquals("0.33-dev", ci.getVersionString());
JarArchive jf = (JarArchive) ldr.getArchive();
Archive.FileEntry je = jf.getJarEntry("META-INF/MANIFEST.MF");
assertNotNull(je);
jf.close();
}
use of org.graalvm.component.installer.model.ComponentInfo in project graal by oracle.
the class InstallerTest method testFailRemoteComponentExisting.
@Test
public void testFailRemoteComponentExisting() throws IOException {
setupComponentInstall("truffleruby2.jar");
ComponentInfo fakeInfo = new ComponentInfo("org.graalvm.ruby", "Fake ruby", "1.0");
storage.installed.add(fakeInfo);
exception.expect(DependencyException.Conflict.class);
exception.expectMessage("VERIFY_ComponentExists");
installer.setFailOnExisting(true);
installer.validateRequirements();
}
use of org.graalvm.component.installer.model.ComponentInfo in project graal by oracle.
the class InstallerTest method testSkipExistingComponent.
@Test
public void testSkipExistingComponent() throws IOException {
setupComponentInstall("truffleruby2.jar");
ComponentInfo fakeInfo = new ComponentInfo("org.graalvm.ruby", "Fake ruby", "1.0");
storage.installed.add(fakeInfo);
installer.setFailOnExisting(false);
assertFalse("Must refuse installation", installer.validateAll());
}
use of org.graalvm.component.installer.model.ComponentInfo in project graal by oracle.
the class InstallerTest method testAcceptComponentUpgrade.
@Test
public void testAcceptComponentUpgrade() throws IOException {
setupComponentInstall("truffleruby2.jar");
ComponentInfo fakeInfo = new ComponentInfo("org.graalvm.ruby", "Fake ruby", "0.32");
storage.installed.add(fakeInfo);
installer.setFailOnExisting(false);
assertTrue("Must refuse installation", installer.validateAll());
}
Aggregations