use of org.eclipse.ceylon.cmr.api.RepositoryManager in project ceylon by eclipse.
the class SmokeTestCase method test2ndTry.
@Test
public void test2ndTry() throws Exception {
RepositoryManager manager = getRepositoryManager();
ArtifactContext ac = new ArtifactContext(null, "test-jar", "0.1");
ArtifactResult result = manager.getArtifactResult(ac);
Assert.assertNull(result);
ac.setSuffixes(ArtifactContext.JAR);
result = manager.getArtifactResult(ac);
Assert.assertNotNull(result);
}
use of org.eclipse.ceylon.cmr.api.RepositoryManager in project ceylon by eclipse.
the class SmokeTestCase method testSimpleOSGi.
@Test
public void testSimpleOSGi() throws Exception {
RepositoryManager manager = getRepositoryManager();
ArtifactContext context = new ArtifactContext(null, "org.osgi.ceylon.simple", "1.0", ArtifactContext.JAR);
try {
Manifest manifest = mockManifest("1.0");
manifest.getMainAttributes().putValue("Require-Bundle", "moduletest;bundle-version=0.1");
manager.putArtifact(context, mockJar("foo", "bar".getBytes(), manifest));
File file = manager.getArtifact(context);
Assert.assertNotNull(file);
} finally {
manager.removeArtifact(context);
}
}
use of org.eclipse.ceylon.cmr.api.RepositoryManager in project ceylon by eclipse.
the class SmokeTestCase method testGetMultipleCached.
@Test
public void testGetMultipleCached() throws Exception {
RepositoryManagerBuilder builder = getRepositoryManagerBuilder(false, 60000, java.net.Proxy.NO_PROXY);
CmrRepository[] externalRepos = builder.repositoryBuilder().buildRepository(Constants.REPO_URL_CEYLON);
for (CmrRepository repo : externalRepos) {
builder.addRepository(repo);
}
RepositoryManager manager = builder.buildRepository();
ArtifactContext artifact1 = new ArtifactContext(null, "ceylon.json", "1.0.0", ArtifactContext.CAR, ArtifactContext.SCRIPTS_ZIPPED, ArtifactContext.JS);
List<ArtifactResult> json1 = manager.getArtifactResults(artifact1);
Assert.assertNotNull("Module 'ceylon.json-1.0.0' not found", json1);
Assert.assertEquals("Expected two artifacts for 'ceylon.json-1.0.0'", 2, json1.size());
File root = new File(manager.getRepositories().get(1).getDisplayString());
File missing = new File(root, "ceylon/json/1.0.0/ceylon.json-1.0.0.scripts.zip.missing");
Assert.assertTrue("Marker file .missing not found", missing.exists());
ArtifactContext artifact2 = new ArtifactContext(null, "ceylon.json", "1.0.0", ArtifactContext.CAR, ArtifactContext.SCRIPTS_ZIPPED, ArtifactContext.SRC);
List<ArtifactResult> json2 = manager.getArtifactResults(artifact2);
Assert.assertNotNull("Module 'ceylon.json-1.0.0' not found", json2);
Assert.assertEquals("Expected two artifacts for 'ceylon.json-1.0.0'", 2, json2.size());
}
use of org.eclipse.ceylon.cmr.api.RepositoryManager in project ceylon by eclipse.
the class SmokeTestCase method testCompleteJsAndJvm.
@Test
public void testCompleteJsAndJvm() throws Exception {
RepositoryManager manager = getRepositoryManager();
ModuleDetails[] expected = new ModuleDetails[] { hello_js_jvm, hello2 };
testComplete("hello", expected, manager, ModuleQuery.Type.CODE);
}
use of org.eclipse.ceylon.cmr.api.RepositoryManager in project ceylon by eclipse.
the class SmokeTestCase method testCompleteEmpty.
@Test
public void testCompleteEmpty() throws Exception {
RepositoryManager manager = getRepositoryManager();
ModuleDetails[] expected = new ModuleDetails[] { com_acme_helloworld, hello, hello2_jvm, moduletest, old_jar, older_jar, test_jar };
testComplete("", expected, manager);
}
Aggregations