Search in sources :

Example 1 with FlatpathModuleLoader

use of org.eclipse.ceylon.module.loader.FlatpathModuleLoader in project ceylon by eclipse.

the class ModuleLoaderTest method testBug7084.

@Test
public void testBug7084() throws IOException {
    Path flatRepo = Files.createTempDirectory("flat-repo");
    try {
        RepositoryManager repositoryManager = CeylonUtils.repoManager().systemRepo("../dist/dist/repo").userRepos(Arrays.asList("flat:" + flatRepo.toAbsolutePath().toString())).buildManager();
        File artifact = repositoryManager.getArtifact(null, "ceylon.collection", "1.3.2");
        Assert.assertNotNull(artifact);
        Files.copy(artifact.toPath(), flatRepo.resolve("ceylon.collection-1.3.2.jar"));
        ModuleLoader moduleLoader = new FlatpathModuleLoader(repositoryManager, null, Collections.<String, String>emptyMap(), true);
        try {
            moduleLoader.loadModule("ceylon.collection", "1.3.2");
        } catch (ModuleNotFoundException e) {
            throw new RuntimeException(e);
        }
    } finally {
        IOUtils.deleteRecursively(flatRepo.toFile());
    }
}
Also used : Path(java.nio.file.Path) FlatpathModuleLoader(org.eclipse.ceylon.module.loader.FlatpathModuleLoader) ModuleLoader(org.eclipse.ceylon.cmr.ceylon.loader.ModuleLoader) FlatpathModuleLoader(org.eclipse.ceylon.module.loader.FlatpathModuleLoader) ModuleNotFoundException(org.eclipse.ceylon.cmr.ceylon.loader.ModuleNotFoundException) SimpleRepositoryManager(org.eclipse.ceylon.cmr.impl.SimpleRepositoryManager) RepositoryManager(org.eclipse.ceylon.cmr.api.RepositoryManager) File(java.io.File) Test(org.junit.Test)

Aggregations

File (java.io.File)1 Path (java.nio.file.Path)1 RepositoryManager (org.eclipse.ceylon.cmr.api.RepositoryManager)1 ModuleLoader (org.eclipse.ceylon.cmr.ceylon.loader.ModuleLoader)1 ModuleNotFoundException (org.eclipse.ceylon.cmr.ceylon.loader.ModuleNotFoundException)1 SimpleRepositoryManager (org.eclipse.ceylon.cmr.impl.SimpleRepositoryManager)1 FlatpathModuleLoader (org.eclipse.ceylon.module.loader.FlatpathModuleLoader)1 Test (org.junit.Test)1