Search in sources :

Example 66 with RepositoryManager

use of org.eclipse.ceylon.cmr.api.RepositoryManager in project ceylon by eclipse.

the class SmokeTestCase method testResolver.

@Test
public void testResolver() throws Exception {
    RepositoryManager manager = getRepositoryManager();
    File file = manager.getArtifact(null, "moduletest", "0.1");
    Assert.assertNotNull(file);
}
Also used : RepositoryManager(org.eclipse.ceylon.cmr.api.RepositoryManager) SimpleRepositoryManager(org.eclipse.ceylon.cmr.impl.SimpleRepositoryManager) File(java.io.File) Test(org.junit.Test)

Example 67 with RepositoryManager

use of org.eclipse.ceylon.cmr.api.RepositoryManager in project ceylon by eclipse.

the class SmokeTestCase method testMavenLocal.

@Test
// this test should work, if you have org.slf4j.slf4j-api 1.5.10 present
@Ignore
public void testMavenLocal() throws Exception {
    RepositoryManager manager = new SimpleRepositoryManager(MavenRepositoryHelper.getMavenRepository(), log);
    ArtifactContext ac = new ArtifactContext(null, "org.slf4j.slf4j-api", "1.5.10");
    File file = manager.getArtifact(ac);
    Assert.assertNotNull(file);
// No remove, as we don't wanna delete from mvn manager
}
Also used : SimpleRepositoryManager(org.eclipse.ceylon.cmr.impl.SimpleRepositoryManager) RepositoryManager(org.eclipse.ceylon.cmr.api.RepositoryManager) SimpleRepositoryManager(org.eclipse.ceylon.cmr.impl.SimpleRepositoryManager) ArtifactContext(org.eclipse.ceylon.cmr.api.ArtifactContext) File(java.io.File) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 68 with RepositoryManager

use of org.eclipse.ceylon.cmr.api.RepositoryManager in project ceylon by eclipse.

the class SmokeTestCase method testExternalNodes.

@Test
public void testExternalNodes() throws Exception {
    RepositoryManagerBuilder builder = getRepositoryManagerBuilder(false, 60000, java.net.Proxy.NO_PROXY);
    InMemoryContentStore imcs = new InMemoryContentStore();
    OpenNode root = imcs.createRoot();
    CmrRepository repo = new DefaultRepository(root);
    RepositoryManager manager = builder.addRepository(repo).buildRepository();
    // a few impl details, feel free to remove/ignore this test
    String name = "org.eclipse.acme";
    String version = "1.0.0.CR1";
    ArtifactContext context = new ArtifactContext(null, name, version);
    // ignore with in-memory
    context.setIgnoreSHA(true);
    OpenNode parent = repo.createParent(context);
    parent.addContent(name + "-" + version + ArtifactContext.CAR, new ByteArrayInputStream("qwerty".getBytes()), context);
    try {
        File file = manager.getArtifact(context);
        Assert.assertNotNull("Failed to retrieve after put", file);
    } finally {
        manager.removeArtifact(null, name, version);
    }
}
Also used : RepositoryManagerBuilder(org.eclipse.ceylon.cmr.api.RepositoryManagerBuilder) DefaultRepository(org.eclipse.ceylon.cmr.impl.DefaultRepository) ByteArrayInputStream(java.io.ByteArrayInputStream) InMemoryContentStore(org.eclipse.ceylon.test.smoke.support.InMemoryContentStore) RepositoryManager(org.eclipse.ceylon.cmr.api.RepositoryManager) SimpleRepositoryManager(org.eclipse.ceylon.cmr.impl.SimpleRepositoryManager) ArtifactContext(org.eclipse.ceylon.cmr.api.ArtifactContext) CmrRepository(org.eclipse.ceylon.cmr.api.CmrRepository) File(java.io.File) OpenNode(org.eclipse.ceylon.cmr.spi.OpenNode) Test(org.junit.Test)

Example 69 with RepositoryManager

use of org.eclipse.ceylon.cmr.api.RepositoryManager in project ceylon by eclipse.

the class SmokeTestCase method testOverridesOptionalImport.

@Test
public void testOverridesOptionalImport() throws Exception {
    RepositoryManager manager = getRepositoryManager("testsuite/src/test/resources/overridesOptionalImport.xml");
    ArtifactResult result = manager.getArtifactResult(null, "moduletest", "0.1");
    Assert.assertNotNull(result);
    Assert.assertEquals(2, result.dependencies().size());
    ArtifactResult dep = result.dependencies().get(1);
    Assert.assertEquals("hello", dep.name());
    Assert.assertEquals("1.2.1", dep.version());
    Assert.assertTrue(dep.optional());
}
Also used : RepositoryManager(org.eclipse.ceylon.cmr.api.RepositoryManager) SimpleRepositoryManager(org.eclipse.ceylon.cmr.impl.SimpleRepositoryManager) ArtifactResult(org.eclipse.ceylon.model.cmr.ArtifactResult) Test(org.junit.Test)

Example 70 with RepositoryManager

use of org.eclipse.ceylon.cmr.api.RepositoryManager in project ceylon by eclipse.

the class SmokeTestCase method testCompleteComDot.

@Test
public void testCompleteComDot() throws Exception {
    RepositoryManager manager = getRepositoryManager();
    ModuleDetails[] expected = new ModuleDetails[] { com_acme_helloworld };
    testComplete("com.", expected, manager);
}
Also used : RepositoryManager(org.eclipse.ceylon.cmr.api.RepositoryManager) SimpleRepositoryManager(org.eclipse.ceylon.cmr.impl.SimpleRepositoryManager) ModuleDetails(org.eclipse.ceylon.cmr.api.ModuleSearchResult.ModuleDetails) Test(org.junit.Test)

Aggregations

RepositoryManager (org.eclipse.ceylon.cmr.api.RepositoryManager)95 Test (org.junit.Test)71 SimpleRepositoryManager (org.eclipse.ceylon.cmr.impl.SimpleRepositoryManager)68 File (java.io.File)47 ArtifactResult (org.eclipse.ceylon.model.cmr.ArtifactResult)32 CmrRepository (org.eclipse.ceylon.cmr.api.CmrRepository)26 ArtifactContext (org.eclipse.ceylon.cmr.api.ArtifactContext)23 ModuleDetails (org.eclipse.ceylon.cmr.api.ModuleSearchResult.ModuleDetails)14 TypeCheckerBuilder (org.eclipse.ceylon.compiler.typechecker.TypeCheckerBuilder)11 RepositoryManagerBuilder (org.eclipse.ceylon.cmr.api.RepositoryManagerBuilder)8 HashMap (java.util.HashMap)7 TypeChecker (org.eclipse.ceylon.compiler.typechecker.TypeChecker)7 ByteArrayInputStream (java.io.ByteArrayInputStream)5 ArrayList (java.util.ArrayList)5 JsModuleManagerFactory (org.eclipse.ceylon.compiler.js.loader.JsModuleManagerFactory)5 ModuleSearchResult (org.eclipse.ceylon.cmr.api.ModuleSearchResult)4 CeylonRepoManagerBuilder (org.eclipse.ceylon.cmr.ceylon.CeylonUtils.CeylonRepoManagerBuilder)4 IOException (java.io.IOException)3 Manifest (java.util.jar.Manifest)3 DefaultRepository (org.eclipse.ceylon.cmr.impl.DefaultRepository)3