use of org.graalvm.component.installer.jar.JarMetaLoader in project graal by oracle.
the class ComponentRegistryTest method setUp.
@Before
public void setUp() throws Exception {
registry = new ComponentRegistry(this, mockStorage);
try (JarFile jf = new JarFile(dataFile("truffleruby2.jar").toFile())) {
ComponentPackageLoader ldr = new JarMetaLoader(jf, this);
rubyInfo = ldr.createComponentInfo();
ldr.loadPaths();
ldr.loadSymlinks();
}
fakeInfo = new ComponentInfo("org.graalvm.fake", "Fake component", "0.32");
fakeInfo.addPaths(Arrays.asList("jre/bin/ruby", "jre/languages/fake/nothing"));
mockStorage.installed.add(fakeInfo);
}
use of org.graalvm.component.installer.jar.JarMetaLoader in project graal by oracle.
the class VerifierTest method testGraalCapabilitiesMismatch.
@Test
public void testGraalCapabilitiesMismatch() throws Exception {
try (JarFile jf = new JarFile(dataFile("truffleruby2.jar").toFile())) {
ComponentPackageLoader ldr = new JarMetaLoader(jf, this);
rubyInfo = ldr.createComponentInfo();
ldr.loadPaths();
ldr.loadSymlinks();
}
mockStorage.graalInfo.put(CAP_OS_NAME, "LiNuy");
Verifier vfy = new Verifier(this, registry, registry);
exception.expect(DependencyException.Mismatch.class);
exception.expectMessage("VERIFY_Dependency_Failed");
vfy.validateRequirements(rubyInfo);
}
use of org.graalvm.component.installer.jar.JarMetaLoader in project graal by oracle.
the class ComponentPackageLoaderTest method setupLoader.
private void setupLoader() throws IOException {
File f = dataFile("data/truffleruby2.jar").toFile();
jf = new JarFile(f);
loader = new JarMetaLoader(jf, this);
info = loader.createComponentInfo();
}
use of org.graalvm.component.installer.jar.JarMetaLoader in project graal by oracle.
the class LicensePresenterTest method createLicensedComponentInfo.
ComponentInfo createLicensedComponentInfo() throws IOException {
Path p = dataFile("licensetest.jar");
JarFile jf = new JarFile(p.toFile());
loader = new JarMetaLoader(jf, this);
licensedInfo = loader.completeMetadata();
return licensedInfo;
}
use of org.graalvm.component.installer.jar.JarMetaLoader in project graal by oracle.
the class CommandTestBase method initURLComponent.
protected void initURLComponent(String relativeJar, String spec) throws IOException {
clu = getClass().getResource(relativeJar);
url = new URL(spec);
Handler.bind(url.toString(), clu);
File f = dataFile(relativeJar).toFile();
JarFile jf = new JarFile(f, false);
ComponentPackageLoader cpl = new JarMetaLoader(jf, this);
info = cpl.getComponentInfo();
// unknown in catalog metadata
info.setLicensePath(null);
info.setRemoteURL(url);
param = rparam = new DownloadURLParam(url, spec, spec, this, false);
}
Aggregations