use of org.graalvm.component.installer.model.ComponentStorage in project graal by oracle.
the class GraalChannelTest method testLoadComponentStorage.
@Test
public void testLoadComponentStorage() throws Exception {
Path p = dataFile("data/releases2.json");
channel.setAllowUpdates(false);
channel.setIndexURL(p.toUri().toURL());
ComponentStorage store = channel.getStorage();
Collection<String> cids = store.listComponentIDs();
assertEquals(5, cids.size());
}
use of org.graalvm.component.installer.model.ComponentStorage in project graal by oracle.
the class GraalChannelTest method testThrowEmptyStorage.
@Test
public void testThrowEmptyStorage() throws Exception {
try {
channel.throwEmptyStorage();
fail("Exception expected");
} catch (IncompatibleException ex) {
// ok
}
ComponentStorage chStorage = channel.throwEmptyStorage();
assertNotNull("Stub storage expected for 2nd time", chStorage);
assertEquals(0, chStorage.listComponentIDs().size());
assertEquals(0, chStorage.loadComponentMetadata("org.graalvm").size());
assertEquals(0, chStorage.loadGraalVersionInfo().size());
}
use of org.graalvm.component.installer.model.ComponentStorage in project graal by oracle.
the class RemoteCatalogDownloaderTest method checkMultipleCatalogResults.
private void checkMultipleCatalogResults(RemoteCatalogDownloader d) throws Exception {
URL clu1 = getClass().getResource("catalogMultiPart1.properties");
Handler.bind(FIRST_CATALOG_URL, clu1);
URL clu2 = getClass().getResource("catalogMultiPart3.properties");
Handler.bind(SECOND_CATALOG_URL, clu2);
ComponentStorage store = d.getStorage();
Set<String> ids = store.listComponentIDs();
assertTrue(ids.contains("ruby"));
assertTrue(ids.contains("r"));
}
use of org.graalvm.component.installer.model.ComponentStorage in project graal by oracle.
the class RemoteCatalogDownloaderTest method testParseCatalogOverride.
/**
* Checks that simple explicit URL given 'the old way' will define a catalog that will be
* loaded.
*
* @throws Exception
*/
@Test
public void testParseCatalogOverride() throws Exception {
storage.graalInfo.put(CommonConstants.CAP_GRAALVM_VERSION, "0.33-dev");
String single = "test://graalv.org/test/catalog.properties";
RemoteCatalogDownloader d = new RemoteCatalogDownloader(this, this, single);
List<SoftwareChannelSource> sources = d.getChannelSources();
assertNotNull(sources);
assertEquals(1, sources.size());
assertEquals(single, sources.get(0).getLocationURL());
URL clu1 = getClass().getResource("catalogMultiVersions.properties");
Handler.bind(single, clu1);
ComponentStorage store = d.getStorage();
Set<String> ids = store.listComponentIDs();
assertTrue(ids.contains("ruby"));
assertTrue(Handler.isVisited(new URL(single)));
}
Aggregations