use of org.graalvm.component.installer.jar.JarArchive 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.jar.JarArchive in project graal by oracle.
the class InstallerTest method setupComponentInstall.
private void setupComponentInstall(String relativePath) throws IOException {
File f = dataFile(relativePath).toFile();
JarFile jf = new JarFile(f);
loader = new JarMetaLoader(jf, this);
componentInfo = loader.createComponentInfo();
componentJarFile = new JarArchive(jf);
loader.loadPaths();
installer = new Installer(fb(), fileOps, componentInfo, registry, registry, componentJarFile);
installer.setInstallPath(targetPath);
installer.setLicenseRelativePath(SystemUtils.fromCommonRelative(loader.getLicensePath()));
}
use of org.graalvm.component.installer.jar.JarArchive in project graal by oracle.
the class CatalogIterableTest method testDirectURLJarClosedAfterJar.
@Test
public void testDirectURLJarClosedAfterJar() throws Exception {
addRemoteComponent("persist/data/truffleruby3.jar", "test://graalvm.io/download/truffleruby.zip", false);
rparam = new DownloadURLParam(url, rparam.getDisplayName(), rparam.getSpecification(), this, false);
components.add(param);
JarArchive jf = (JarArchive) rparam.getArchive();
assertNotNull(jf.getEntry("META-INF"));
rparam.close();
exception.expect(IllegalStateException.class);
jf.getEntry("META-INF");
}
use of org.graalvm.component.installer.jar.JarArchive in project graal by oracle.
the class CatalogIterableTest method testDirectURLJarClosedAfterMeta.
@Test
public void testDirectURLJarClosedAfterMeta() throws Exception {
addRemoteComponent("persist/data/truffleruby3.jar", "test://graalvm.io/download/truffleruby.zip", false);
rparam = new DownloadURLParam(url, rparam.getDisplayName(), rparam.getSpecification(), this, false);
components.add(param);
URL remoteU = rparam.createMetaLoader().getComponentInfo().getRemoteURL();
assertEquals(url, remoteU);
JarArchive jf = (JarArchive) rparam.getArchive();
assertNotNull(jf.getEntry("META-INF"));
rparam.close();
exception.expect(IllegalStateException.class);
jf.getEntry("META-INF");
}
Aggregations