Search in sources :

Example 21 with CatalogIterable

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

the class CatalogInstallTest method testInstallDepsWithDependecnyInstalledCommon.

private void testInstallDepsWithDependecnyInstalledCommon() throws Exception {
    ComponentInfo fakeInfo = new ComponentInfo("org.graalvm.llvm-toolchain", "Fake Toolchain", "19.3-dev");
    fakeInfo.setInfoPath("");
    storage.installed.add(fakeInfo);
    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);
    assertTrue(cmd.getDependencies().isEmpty());
}
Also used : ComponentInfo(org.graalvm.component.installer.model.ComponentInfo) CatalogIterable(org.graalvm.component.installer.remote.CatalogIterable)

Example 22 with CatalogIterable

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

the class CatalogInstallTest method testInstallWithIgnoredDeps.

@Test
public void testInstallWithIgnoredDeps() throws Exception {
    setupVersion("19.3-dev");
    setupCatalog(null);
    paramIterable = new CatalogIterable(this, this);
    textParams.add("r");
    options.put(Commands.OPTION_NO_DEPENDENCIES, "");
    InstallCommand cmd = new InstallCommand();
    cmd.init(this, withBundle(InstallCommand.class));
    cmd.executionInit();
    cmd.executeStep(cmd::prepareInstallation, false);
    List<ComponentParam> deps = cmd.getDependencies();
    assertTrue(deps.isEmpty());
}
Also used : ComponentParam(org.graalvm.component.installer.ComponentParam) CatalogIterable(org.graalvm.component.installer.remote.CatalogIterable) Test(org.junit.Test)

Example 23 with CatalogIterable

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

the class CatalogInstallTest method testInstallCorrectJavaVersion11.

@Test
public void testInstallCorrectJavaVersion11() throws Exception {
    storage.graalInfo.put(CommonConstants.CAP_JAVA_VERSION, "11");
    setupVersion("1.0.0.0");
    setupCatalog("catalogMultiFlavours.properties");
    paramIterable = new CatalogIterable(this, this);
    textParams.add("ruby");
    InstallCommand cmd = new InstallCommand();
    cmd.init(this, withBundle(InstallCommand.class));
    cmd.executionInit();
    cmd.executeStep(cmd::prepareInstallation, false);
    List<Installer> installers = cmd.getInstallers();
    assertEquals(1, installers.size());
}
Also used : CatalogIterable(org.graalvm.component.installer.remote.CatalogIterable) Test(org.junit.Test)

Example 24 with CatalogIterable

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

the class CatalogInstallTest method testInstallWithBrokenIgnoredDeps.

@Test
public void testInstallWithBrokenIgnoredDeps() throws Exception {
    setupVersion("19.3-dev");
    setupCatalog(null);
    paramIterable = new CatalogIterable(this, this);
    textParams.add("additional");
    options.put(Commands.OPTION_NO_DEPENDENCIES, "");
    InstallCommand cmd = new InstallCommand();
    cmd.init(this, withBundle(InstallCommand.class));
    cmd.executionInit();
    cmd.executeStep(cmd::prepareInstallation, false);
}
Also used : CatalogIterable(org.graalvm.component.installer.remote.CatalogIterable) Test(org.junit.Test)

Example 25 with CatalogIterable

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

the class CatalogInstallTest method testPostinstMessagePrinted.

@Test
public void testPostinstMessagePrinted() throws Exception {
    setupVersion("0.33");
    URL x = getClass().getResource("postinst2.jar");
    URL rubyURL = new URL("test://release/postinst2.jar");
    Handler.bind(rubyURL.toString(), x);
    setupCatalog(null);
    paramIterable = new CatalogIterable(this, this);
    textParams.add("ruby");
    InstallCommand cmd = new InstallCommand();
    cmd.init(this, withBundle(InstallCommand.class));
    String[] formatted = new String[1];
    delegateFeedback(new FeedbackAdapter() {

        @Override
        public boolean verbatimOut(String aMsg, boolean beVerbose) {
            if (aMsg.contains("Ruby openssl")) {
                // NOI18N
                formatted[0] = aMsg;
            }
            return super.verbatimOut(aMsg, beVerbose);
        }
    });
    cmd.execute();
    assertNotNull(formatted[0]);
}
Also used : CatalogIterable(org.graalvm.component.installer.remote.CatalogIterable) URL(java.net.URL) 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