Search in sources :

Example 11 with CatalogIterable

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

the class InstallLicensedCatalogTest method initCatalogIterable.

private void initCatalogIterable(URL u) {
    GraalChannel channel = new GraalChannel(this, this, getLocalRegistry());
    channel.setIndexURL(u);
    cfactory = new CatalogFactory() {

        @Override
        public ComponentCatalog createComponentCatalog(CommandInput input) {
            try {
                return new CatalogContents(InstallLicensedCatalogTest.this, channel.getStorage(), localRegistry);
            } catch (IOException ex) {
                fail("Unexpected exception");
                return null;
            }
        }

        @Override
        public List<GraalEdition> listEditions(ComponentRegistry targetGraalVM) {
            return Collections.emptyList();
        }
    };
    paramIterable = new CatalogIterable(this, this);
}
Also used : ComponentCatalog(org.graalvm.component.installer.ComponentCatalog) GraalChannel(org.graalvm.component.installer.gds.GraalChannel) CommandInput(org.graalvm.component.installer.CommandInput) ComponentRegistry(org.graalvm.component.installer.model.ComponentRegistry) CatalogContents(org.graalvm.component.installer.model.CatalogContents) List(java.util.List) IOException(java.io.IOException) CatalogIterable(org.graalvm.component.installer.remote.CatalogIterable)

Example 12 with CatalogIterable

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

the class InstallVersionsTest method initVersion.

private Version initVersion(String s) throws IOException {
    Version v = Version.fromString(s);
    storage.graalInfo.put(BundleConstants.GRAAL_VERSION, s);
    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)

Example 13 with CatalogIterable

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

the class InstallTest method initCatalogIterable.

private void initCatalogIterable(URL u) {
    RemoteCatalogDownloader rcd = new RemoteCatalogDownloader(this, this, u);
    registry = new CatalogContents(this, rcd.getStorage(), localRegistry);
    componentIterable = new CatalogIterable(this, this);
}
Also used : CatalogContents(org.graalvm.component.installer.model.CatalogContents) RemoteCatalogDownloader(org.graalvm.component.installer.remote.RemoteCatalogDownloader) CatalogIterable(org.graalvm.component.installer.remote.CatalogIterable)

Example 14 with CatalogIterable

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

the class UpgradeTest method initVersion.

private Version initVersion(String s, String catalogResource) throws IOException {
    Version v = Version.fromString(s);
    storage.graalInfo.put(BundleConstants.GRAAL_VERSION, s);
    Path catalogPath = dataFile(catalogResource);
    downloader = new RemoteCatalogDownloader(this, this, catalogPath.toUri().toURL());
    registry = new CatalogContents(this, downloader.getStorage(), localRegistry);
    paramIterable = new CatalogIterable(this, this);
    helper = new UpgradeProcess(this, this, registry);
    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)

Example 15 with CatalogIterable

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

the class InstallFromGdsTest method setUp.

@Override
@Before
public void setUp() throws Exception {
    super.setUp();
    storage.graalInfo.put(CommonConstants.CAP_GRAALVM_VERSION, "20.3.0");
    Handler.bind("test://acme.org/GRAALVM_EE_JAVA8_20.3.0/license.txt", dataFile("data/license.txt").toUri().toURL());
    gdsDownloadFolder = dataFile("data");
    gdsCatalogPath = gdsDownloadFolder.resolve("insttest.json");
    gdsUrl = "{ee}gds:" + gdsCatalogPath.toUri().toURL().toString();
    catalogStorage.graalInfo.put(CommonConstants.RELEASE_CATALOG_KEY, gdsUrl);
    iterableInstance = new CatalogIterable(this, this);
    gl = new GraalEditionList(this, this, getLocalRegistry());
    gl.setDefaultCatalogSpec(gdsUrl);
    gl.setDefaultEdition(gl.getEdition("ee"));
}
Also used : GraalEditionList(org.graalvm.component.installer.remote.GraalEditionList) CatalogIterable(org.graalvm.component.installer.remote.CatalogIterable) Before(org.junit.Before)

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