Search in sources :

Example 26 with RepositoryManager

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

the class SmokeTestCase method testCompleteEmptyJS.

@Test
public void testCompleteEmptyJS() throws Exception {
    RepositoryManager manager = getRepositoryManager();
    ModuleDetails[] expected = new ModuleDetails[] { com_acme_helloworld_js, hello_js, hello2_js, jsonly, moduletest_js };
    testComplete("", expected, manager, ModuleQuery.Type.JS);
}
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)

Example 27 with RepositoryManager

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

the class SmokeTestCase method testXmlResolver.

@Test
public void testXmlResolver() throws Exception {
    RepositoryManager manager = getRepositoryManager();
    ArtifactContext context = new ArtifactContext(null, "older-jar", "12-b3", ArtifactContext.JAR);
    File file = manager.getArtifact(context);
    Assert.assertNotNull(file);
}
Also used : 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) Test(org.junit.Test)

Example 28 with RepositoryManager

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

the class SmokeTestCase method testOverridesReplaceGlobalNoVersion.

@Test
public void testOverridesReplaceGlobalNoVersion() throws Exception {
    RepositoryManager manager = getRepositoryManager("testsuite/src/test/resources/overridesReplaceGlobalNoVersion.xml");
    ArtifactResult result = manager.getArtifactResult(null, "com.acme.helloworld", "1.0.0");
    Assert.assertNotNull(result);
    Assert.assertEquals("hello", result.name());
    Assert.assertEquals("1.2.1", result.version());
    Assert.assertEquals(1, result.dependencies().size());
}
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 29 with RepositoryManager

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

the class SmokeTestCase method testFolderPut.

@Test
public void testFolderPut() throws Exception {
    RepositoryManager manager = getRepositoryManager();
    File docs = new File(getFolders(), "docs");
    String name = "org.eclipse.docs";
    String version = "1.0.0.CR3";
    ArtifactContext template = new ArtifactContext();
    template.setName(name);
    template.setVersion(version);
    ArtifactContext context = template.getDocsContext();
    manager.putArtifact(context, docs);
    try {
        File copy = manager.getArtifact(context);
        File x = new File(copy, "x.txt");
        Assert.assertTrue(x.exists());
        File y = new File(copy, "sub/y.txt");
        Assert.assertTrue(y.exists());
    } finally {
        manager.removeArtifact(context);
    }
}
Also used : 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) Test(org.junit.Test)

Example 30 with RepositoryManager

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

the class SmokeTestCase method testOverridesShareImport.

@Test
public void testOverridesShareImport() throws Exception {
    RepositoryManager manager = getRepositoryManager("testsuite/src/test/resources/overridesShareImport.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.exported());
}
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)

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