Search in sources :

Example 26 with CatalogIterable

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

the class CatalogInstallTest method testInstallWithDepsSingleLevel.

@Test
public void testInstallWithDepsSingleLevel() throws Exception {
    setupVersion("19.3-dev");
    setupCatalog(null);
    paramIterable = new CatalogIterable(this, this);
    textParams.add("r");
    InstallCommand cmd = new InstallCommand();
    cmd.init(this, withBundle(InstallCommand.class));
    cmd.executionInit();
    cmd.executeStep(cmd::prepareInstallation, false);
    List<ComponentParam> deps = cmd.getDependencies();
    assertEquals(1, deps.size());
    assertEquals("org.graalvm.llvm-toolchain", deps.get(0).createMetaLoader().getComponentInfo().getId());
}
Also used : ComponentParam(org.graalvm.component.installer.ComponentParam) CatalogIterable(org.graalvm.component.installer.remote.CatalogIterable) Test(org.junit.Test)

Example 27 with CatalogIterable

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

the class CatalogIterableTest method testWildardSorted.

@Test
public void testWildardSorted() throws Exception {
    setupCatalog();
    textParams.add("r*");
    CatalogIterable cit = new CatalogIterable(this, this);
    Iterator<ComponentParam> comps = cit.iterator();
    List<String> fullIds = new ArrayList<>();
    for (; comps.hasNext(); ) {
        ComponentParam cp = comps.next();
        fullIds.add(cp.createMetaLoader().getComponentInfo().getId());
    }
    assertEquals(2, fullIds.size());
    assertEquals("org.graalvm.r", fullIds.get(0));
    assertEquals("org.graalvm.ruby", fullIds.get(1));
}
Also used : ArrayList(java.util.ArrayList) CatalogIterable(org.graalvm.component.installer.remote.CatalogIterable) Test(org.junit.Test)

Example 28 with CatalogIterable

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

the class CatalogIterableTest method testSelectSomeComponents.

@Test
public void testSelectSomeComponents() throws Exception {
    setupCatalog();
    textParams.add("*mage");
    textParams.add("llvm*");
    CatalogIterable cit = new CatalogIterable(this, this);
    Iterator<ComponentParam> comps = cit.iterator();
    List<String> fullIds = new ArrayList<>();
    for (; comps.hasNext(); ) {
        ComponentParam cp = comps.next();
        fullIds.add(cp.createMetaLoader().getComponentInfo().getId());
    }
    assertEquals(2, fullIds.size());
}
Also used : ArrayList(java.util.ArrayList) CatalogIterable(org.graalvm.component.installer.remote.CatalogIterable) Test(org.junit.Test)

Example 29 with CatalogIterable

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

the class CatalogIterableTest method testAllComponents.

@Test
public void testAllComponents() throws Exception {
    setupCatalog();
    textParams.add("*");
    CatalogIterable cit = new CatalogIterable(this, this);
    Iterator<ComponentParam> comps = cit.iterator();
    List<String> fullIds = new ArrayList<>();
    for (; comps.hasNext(); ) {
        ComponentParam cp = comps.next();
        fullIds.add(cp.createMetaLoader().getComponentInfo().getId());
    }
    assertEquals(5, fullIds.size());
}
Also used : ArrayList(java.util.ArrayList) CatalogIterable(org.graalvm.component.installer.remote.CatalogIterable) Test(org.junit.Test)

Example 30 with CatalogIterable

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

the class CatalogIterableTest method testUnknownComponentSpecified.

@Test
public void testUnknownComponentSpecified() throws Exception {
    exception.expect(FailedOperationException.class);
    exception.expectMessage("REMOTE_UnknownComponentId");
    addRemoteComponent("persist/data/truffleruby3.jar", "test://graalvm.io/download/truffleruby.zip", false);
    textParams.add("r");
    CatalogIterable cit = new CatalogIterable(this, this);
    assertTrue(cit.iterator().hasNext());
    cit.iterator().next();
}
Also used : CatalogIterable(org.graalvm.component.installer.remote.CatalogIterable) Test(org.junit.Test)

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