use of org.graalvm.component.installer.SoftwareChannelSource in project graal by oracle.
the class GraalEditionListTest method checkOverrideCommon.
private void checkOverrideCommon() throws Exception {
GraalEditionList list = new GraalEditionList(this, this, getLocalRegistry());
list.setOverrideCatalogSpec("https://www.graalvm.org/component-catalog/graal-updater-component-catalog-java8x.properties");
List<GraalEdition> eds = list.editions();
assertEquals(1, eds.size());
assertEquals(list.getDefaultEdition(), eds.get(0));
GraalEdition ge = eds.get(0);
assertEquals("ce", ge.getId());
assertSame(ge, list.getEdition(null));
List<SoftwareChannelSource> channels = ge.getSoftwareSources();
assertEquals(1, channels.size());
assertTrue(channels.get(0).getLocationURL().endsWith("java8x.properties"));
}
use of org.graalvm.component.installer.SoftwareChannelSource in project graal by oracle.
the class GraalEditionListTest method testCheck21MultipleProperties.
@Test
public void testCheck21MultipleProperties() throws Exception {
loadReleaseFile("release21ce.properties");
storage.graalInfo.put(CommonConstants.CAP_EDITION, "ce");
GraalEditionList list = new GraalEditionList(this, this, getLocalRegistry());
list.setDefaultCatalogSpec(storage.graalInfo.get(CommonConstants.RELEASE_CATALOG_KEY));
List<GraalEdition> eds = list.editions();
assertEquals(1, eds.size());
GraalEdition ge = eds.get(0);
List<SoftwareChannelSource> sources = ge.getSoftwareSources();
assertEquals("Expected default edition", "ce", ge.getId());
assertEquals("Expected 2 sources from multiproperties", 2, sources.size());
}
use of org.graalvm.component.installer.SoftwareChannelSource in project graal by oracle.
the class DirectoryCatalogProviderTest method testNoErrorsWithLocalCatalogs.
/**
* Checks that the merging catalog initializes the directory provider correctly.
*
* @throws Exception
*/
@Test
public void testNoErrorsWithLocalCatalogs() throws Exception {
URL clu = getClass().getResource("data/catalog");
URL u = new URL("test://graalvm.io/download/truffleruby.zip");
Handler.bind(u.toString(), clu);
Path testData = dataFile("dir1");
SoftwareChannelSource scs = new SoftwareChannelSource(testData.toUri().toURL().toString(), "local dir");
storage.graalInfo.put(CommonConstants.CAP_GRAALVM_VERSION, "0.33-dev");
FB fb = new FB();
delegateFeedback(fb);
RemoteCatalogDownloader d = new RemoteCatalogDownloader(this, this, u);
d.addLocalChannelSource(scs);
registry = openCatalog(d);
// directory contents scanned / component found
ComponentInfo info = registry.findComponent("org.graalvm.llvm-toolchain");
assertNotNull(info);
// catalog loaded / component found
info = registry.findComponent("ruby");
assertNotNull(info);
// no errors
assertTrue(fb.errs.isEmpty());
}
use of org.graalvm.component.installer.SoftwareChannelSource 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);
}
Aggregations