Search in sources :

Example 31 with CatalogIterable

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

the class CatalogIterableTest method testReadComponentMetadataNoNetwork.

@Test
public void testReadComponentMetadataNoNetwork() throws Exception {
    addRemoteComponent("persist/data/truffleruby3.jar", "test://graalvm.io/download/truffleruby.zip", false);
    textParams.add("ruby");
    CatalogIterable cit = new CatalogIterable(this, this);
    assertTrue(cit.iterator().hasNext());
    for (ComponentParam p : cit) {
        URL remoteU = p.createMetaLoader().getComponentInfo().getRemoteURL();
        assertEquals(url, remoteU);
    }
    assertFalse(Handler.isVisited(url));
}
Also used : CatalogIterable(org.graalvm.component.installer.remote.CatalogIterable) URL(java.net.URL) Test(org.junit.Test)

Example 32 with CatalogIterable

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

the class CatalogIterableTest method testNoWildcards.

/**
 * Checks that a parameter without wildcards will act as a literal.
 */
@Test
public void testNoWildcards() throws Exception {
    setupCatalog();
    textParams.add("ruby");
    CatalogIterable cit = new CatalogIterable(this, this);
    Iterator<ComponentParam> comps = cit.iterator();
    ComponentParam c;
    c = comps.next();
    assertFalse(comps.hasNext());
    assertEquals("org.graalvm.ruby", c.createMetaLoader().getComponentInfo().getId());
}
Also used : CatalogIterable(org.graalvm.component.installer.remote.CatalogIterable) Test(org.junit.Test)

Example 33 with CatalogIterable

use of org.graalvm.component.installer.remote.CatalogIterable 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

CatalogIterable (org.graalvm.component.installer.remote.CatalogIterable)33 Test (org.junit.Test)22 ComponentInfo (org.graalvm.component.installer.model.ComponentInfo)7 URL (java.net.URL)5 ComponentParam (org.graalvm.component.installer.ComponentParam)5 CatalogContents (org.graalvm.component.installer.model.CatalogContents)5 IOException (java.io.IOException)4 Path (java.nio.file.Path)4 ArrayList (java.util.ArrayList)4 RemoteCatalogDownloader (org.graalvm.component.installer.remote.RemoteCatalogDownloader)4 URLConnection (java.net.URLConnection)3 Version (org.graalvm.component.installer.Version)3 GraalEditionList (org.graalvm.component.installer.remote.GraalEditionList)2 File (java.io.File)1 FileNotFoundException (java.io.FileNotFoundException)1 InputStream (java.io.InputStream)1 List (java.util.List)1 Map (java.util.Map)1 Set (java.util.Set)1 CommandInput (org.graalvm.component.installer.CommandInput)1