use of org.eclipse.ceylon.cmr.api.RepositoryManagerBuilder in project ceylon by eclipse.
the class BuilderTestCase method testDefault.
@Test
public void testDefault() throws Exception {
try {
// property not set
RepositoryManagerBuilder builder = getRepositoryManagerBuilder(false, 60000, java.net.Proxy.NO_PROXY);
assertBuilder(builder, RepositoryManagerBuilderImpl.class);
// blank
System.setProperty("ceylon.module.resolver.builder", "");
builder = getRepositoryManagerBuilder(false, 60000, java.net.Proxy.NO_PROXY);
assertBuilder(builder, RepositoryManagerBuilderImpl.class);
} finally {
System.clearProperty("ceylon.module.resolver.builder");
}
}
use of org.eclipse.ceylon.cmr.api.RepositoryManagerBuilder in project ceylon by eclipse.
the class HerdTestCase method getRepositoryManager.
private RepositoryManager getRepositoryManager(File root, boolean offline, int timeout, String apiVersion) throws Exception {
RepositoryManagerBuilder builder = getRepositoryManagerBuilder(root, offline, timeout, java.net.Proxy.NO_PROXY);
WebDAVContentStore rcs = new WebDAVContentStore(HERD_URL, log, false, 60000, java.net.Proxy.NO_PROXY, apiVersion);
CmrRepository repo = new DefaultRepository(rcs.createRoot());
return builder.addRepository(repo).buildRepository();
}
use of org.eclipse.ceylon.cmr.api.RepositoryManagerBuilder in project ceylon by eclipse.
the class SmokeTestCase method testMavenRemote.
@Test
public void testMavenRemote() throws Exception {
RepositoryManagerBuilder builder = getRepositoryManagerBuilder(false, 60000, java.net.Proxy.NO_PROXY);
CmrRepository externalRepo = MavenRepositoryHelper.getMavenRepository("https://repository.jboss.org/nexus/content/groups/public", log, false, 60000, java.net.Proxy.NO_PROXY);
builder.addRepository(externalRepo);
RepositoryManager manager = builder.buildRepository();
ArtifactContext ac = new ArtifactContext(MavenRepository.NAMESPACE, "org.jboss:jboss-vfs", "3.0.1.GA", ArtifactContext.JAR);
File file = null;
try {
file = manager.getArtifact(ac);
Assert.assertNotNull(file);
Assert.assertEquals("jboss-vfs-3.0.1.GA.jar", file.getName());
} finally {
// delete the jar, not the car
ac.setSuffixes(ArtifactContext.JAR);
manager.removeArtifact(ac);
// temporary workaround, because the jar is not stored at the right place
if (file != null)
Assert.assertTrue(file.delete());
}
}
use of org.eclipse.ceylon.cmr.api.RepositoryManagerBuilder 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.RepositoryManagerBuilder in project ceylon by eclipse.
the class SmokeTestCase method testPropertiesGet.
@Test
public void testPropertiesGet() throws Exception {
RepositoryManagerBuilder builder = getRepositoryManagerBuilder(false, 60000, java.net.Proxy.NO_PROXY);
RepositoryBuilder rb = builder.repositoryBuilder();
CmrRepository[] repositories = rb.buildRepository(Constants.REPO_URL_CEYLON);
for (CmrRepository repo : repositories) {
builder.addRepository(repo);
}
RepositoryManager manager = builder.buildRepository();
ArtifactContext context = new ArtifactContext(null, "io.undertow.core", "1.0.0.Alpha1-9fdfd5f766", ArtifactContext.JAR);
try {
File artifact = manager.getArtifact(context);
Assert.assertNotNull(artifact);
File mp = new File(artifact.getParent(), ArtifactContext.MODULE_PROPERTIES);
Assert.assertNotNull(mp.exists());
} finally {
manager.removeArtifact(context);
}
}
Aggregations