Search in sources :

Example 11 with RemoteCatalogDownloader

use of org.graalvm.component.installer.remote.RemoteCatalogDownloader in project graal by oracle.

the class DirectoryChannelFactoryTest method testLoadFromEmptyDirectory.

@Test
public void testLoadFromEmptyDirectory() throws Exception {
    Path nf = testFolder.newFolder().toPath();
    Path ruby033 = dataFile("data/truffleruby3.jar");
    Files.copy(ruby033, nf.resolve(ruby033.getFileName()));
    // truffleruby3 declares that version
    storage.graalInfo.put(BundleConstants.GRAAL_VERSION, "0.33-dev");
    downloader = new RemoteCatalogDownloader(this, this, (URL) null);
    SoftwareChannelSource scs = new SoftwareChannelSource(nf.toUri().toString());
    downloader.addLocalChannelSource(scs);
    ComponentInfo info = getRegistry().findComponent("ruby");
    assertNotNull(info);
}
Also used : Path(java.nio.file.Path) SoftwareChannelSource(org.graalvm.component.installer.SoftwareChannelSource) RemoteCatalogDownloader(org.graalvm.component.installer.remote.RemoteCatalogDownloader) ComponentInfo(org.graalvm.component.installer.model.ComponentInfo) URL(java.net.URL) Test(org.junit.Test)

Example 12 with RemoteCatalogDownloader

use of org.graalvm.component.installer.remote.RemoteCatalogDownloader in project graal by oracle.

the class DirectoryChannelFactoryTest method testEmptyDownloaderProducesNothing.

@Test
public void testEmptyDownloaderProducesNothing() throws Exception {
    downloader = new RemoteCatalogDownloader(this, this, (URL) null);
    ComponentInfo info = getRegistry().findComponent("org.graalvm.ruby");
    assertNull(info);
}
Also used : RemoteCatalogDownloader(org.graalvm.component.installer.remote.RemoteCatalogDownloader) ComponentInfo(org.graalvm.component.installer.model.ComponentInfo) URL(java.net.URL) Test(org.junit.Test)

Example 13 with RemoteCatalogDownloader

use of org.graalvm.component.installer.remote.RemoteCatalogDownloader in project graal by oracle.

the class CatalogInstallTest method setupCatalog2.

private void setupCatalog2(String rel) throws IOException {
    Path p = dataFile(rel);
    URL u = p.toUri().toURL();
    downloader = new RemoteCatalogDownloader(this, this, u);
    this.registry = new CatalogContents(this, downloader.getStorage(), getLocalRegistry());
}
Also used : Path(java.nio.file.Path) CatalogContents(org.graalvm.component.installer.model.CatalogContents) RemoteCatalogDownloader(org.graalvm.component.installer.remote.RemoteCatalogDownloader) URL(java.net.URL)

Example 14 with RemoteCatalogDownloader

use of org.graalvm.component.installer.remote.RemoteCatalogDownloader in project graal by oracle.

the class InfoTest method initVersion.

private Version initVersion(String s) throws IOException {
    Version v = Version.fromString(s);
    storage.graalInfo.put(BundleConstants.GRAAL_VERSION, v.toString());
    Path catalogPath = dataFile("../repo/catalog.properties");
    RemoteCatalogDownloader downloader = new RemoteCatalogDownloader(this, this, catalogPath.toUri().toURL());
    registry = new CatalogContents(this, downloader.getStorage(), localRegistry);
    paramIterable = new CatalogIterable(this, this);
    return v;
}
Also used : Path(java.nio.file.Path) Version(org.graalvm.component.installer.Version) CatalogContents(org.graalvm.component.installer.model.CatalogContents) RemoteCatalogDownloader(org.graalvm.component.installer.remote.RemoteCatalogDownloader) CatalogIterable(org.graalvm.component.installer.remote.CatalogIterable)

Aggregations

RemoteCatalogDownloader (org.graalvm.component.installer.remote.RemoteCatalogDownloader)14 CatalogContents (org.graalvm.component.installer.model.CatalogContents)11 URL (java.net.URL)8 Path (java.nio.file.Path)8 ComponentInfo (org.graalvm.component.installer.model.ComponentInfo)6 Test (org.junit.Test)6 CatalogIterable (org.graalvm.component.installer.remote.CatalogIterable)4 List (java.util.List)3 CommandInput (org.graalvm.component.installer.CommandInput)3 ComponentCatalog (org.graalvm.component.installer.ComponentCatalog)3 SoftwareChannelSource (org.graalvm.component.installer.SoftwareChannelSource)3 Version (org.graalvm.component.installer.Version)3 ComponentRegistry (org.graalvm.component.installer.model.ComponentRegistry)3 HashSet (java.util.HashSet)1 ComponentParam (org.graalvm.component.installer.ComponentParam)1 FileIterable (org.graalvm.component.installer.FileIterable)1 MetadataLoader (org.graalvm.component.installer.persist.MetadataLoader)1