use of org.graalvm.component.installer.model.ComponentInfo in project graal by oracle.
the class DirectoryStorageTest method testStabilityLevelLoadsOld.
/**
* Checks that stability level is loaded from the old property as well. Not strictly necessary,
* but may improve compatibility for older bundled stuff.
*/
@Test
public void testStabilityLevelLoadsOld() throws Exception {
Files.write(registryPath.resolve("x.component"), Arrays.asList("Bundle-Name=y", "Bundle-Symbolic-Name=x", "Bundle-Version=2.0", "x-GraalVM-Stability=experimental-earlyadopter"));
Set<ComponentInfo> loaded = storage.loadComponentMetadata("x");
assertEquals(1, loaded.size());
ComponentInfo compare = loaded.iterator().next();
assertEquals(StabilityLevel.Experimental_Earlyadopter, compare.getStability());
}
use of org.graalvm.component.installer.model.ComponentInfo in project graal by oracle.
the class DirectoryStorageTest method testCheckedAcceptedURLLicenseListed.
/**
* When listing licenses, Ids cannot be transliterated back, so they are stored\ aside.
*
* @throws Exception
*/
@Test
public void testCheckedAcceptedURLLicenseListed() throws Exception {
String urlString = "http://acme.org/license.txt";
copyDir("list1", registryPath);
ComponentInfo info = loadLastComponent("fastr");
enableLicensesForTesting();
storage.recordLicenseAccepted(info, urlString, "This is a dummy license", null);
Map<String, Collection<String>> lics = storage.findAcceptedLicenses();
assertNotNull(lics.get(urlString));
}
use of org.graalvm.component.installer.model.ComponentInfo in project graal by oracle.
the class CatalogCompatTest method testMixedFormatAllowsFutureVersions.
/**
* Checks that if a catalog mixes in new-format entries, they're read and processed for new
* versions, too.
*
* @throws Exception
*/
@Test
public void testMixedFormatAllowsFutureVersions() throws Exception {
storage.graalInfo.put(CommonConstants.CAP_GRAALVM_VERSION, "1.0.0");
setupCatalogFormat1("catalogFormatMix.properties");
List<ComponentInfo> infos;
Version gv = getLocalRegistry().getGraalVersion();
Version.Match selector = gv.match(Version.Match.Type.INSTALLABLE);
// check that versions 1.0.0-rcX are ignored for version 1.0.0
infos = new ArrayList<>(registry.loadComponents("ruby", selector, verbose));
assertNotNull(infos);
assertEquals(3, infos.size());
Collections.sort(infos, ComponentInfo.versionComparator());
ComponentInfo one = infos.get(0);
ComponentInfo two = infos.get(1);
ComponentInfo three = infos.get(2);
assertEquals("1.0.0", one.getVersionString());
assertEquals("1.0.1.0", two.getVersionString());
assertEquals("1.0.2.0-1", three.getVersionString());
}
use of org.graalvm.component.installer.model.ComponentInfo in project graal by oracle.
the class CatalogCompatTest method testOldFormatIgnoresPrevVersionsAvailable.
/**
* Checks that previous versions (RCs) are ignored with the old format.
*
* @throws Exception
*/
@Test
public void testOldFormatIgnoresPrevVersionsAvailable() throws Exception {
storage.graalInfo.put(CommonConstants.CAP_GRAALVM_VERSION, "1.0.0");
setupCatalogFormat1("catalogFormat1.properties");
// interprets user input for 'available'
Version gv = getLocalRegistry().getGraalVersion();
Version.Match selector = gv.match(Version.Match.Type.INSTALLABLE);
List<ComponentInfo> infos;
// check that versions 1.0.0-rcX are ignored for version 1.0.0
infos = new ArrayList<>(registry.loadComponents("ruby", selector, verbose));
assertEquals(1, infos.size());
infos = new ArrayList<>(registry.loadComponents("python", selector, verbose));
assertEquals(1, infos.size());
infos = new ArrayList<>(registry.loadComponents("r", selector, verbose));
assertEquals(1, infos.size());
}
use of org.graalvm.component.installer.model.ComponentInfo in project graal by oracle.
the class CatalogCompatTest method testOldFormatIgnoresPrevVersionsMostRecent.
/**
* Checks that previous versions (RCs) are ignored with the old format.
*
* @throws Exception
*/
@Test
public void testOldFormatIgnoresPrevVersionsMostRecent() throws Exception {
storage.graalInfo.put(CommonConstants.CAP_GRAALVM_VERSION, "1.0.0");
setupCatalogFormat1("catalogFormat1.properties");
// copied from CatalogIterable, this is what interprets user input for install
Version gv = getLocalRegistry().getGraalVersion();
Version.Match selector = gv.match(Version.Match.Type.MOSTRECENT);
List<ComponentInfo> infos;
// check that versions 1.0.0-rcX are ignored for version 1.0.0
infos = new ArrayList<>(registry.loadComponents("ruby", selector, verbose));
assertEquals(1, infos.size());
infos = new ArrayList<>(registry.loadComponents("python", selector, verbose));
assertEquals(1, infos.size());
infos = new ArrayList<>(registry.loadComponents("r", selector, verbose));
assertEquals(1, infos.size());
}
Aggregations