use of org.eclipse.ceylon.model.cmr.ArtifactResult in project ceylon by eclipse.
the class AetherTestCase method testAetherJarless.
@Test
public void testAetherJarless() throws Throwable {
CmrRepository repository = AetherRepository.createRepository(log, false, 60000);
RepositoryManager manager = new SimpleRepositoryManager(repository, log);
ArtifactResult result = manager.getArtifactResult(MavenArtifactContext.NAMESPACE, "javax.mail:mail", "1.3.2");
Assert.assertNotNull(result);
File artifact = result.artifact();
boolean exists = false;
try {
Assert.assertNotNull(artifact);
Assert.assertTrue(artifact.exists());
Assert.assertTrue(ModuleUtil.isMavenJarlessModule(artifact));
exists = true;
List<ArtifactResult> deps = result.dependencies();
Assert.assertEquals(1, deps.size());
log.debug("deps = " + deps);
} finally {
if (exists) {
// delete this one
Assert.assertTrue(artifact.delete());
}
}
}
use of org.eclipse.ceylon.model.cmr.ArtifactResult in project ceylon by eclipse.
the class AetherTestCase method testAetherWithSemiColonModule.
@Test
public void testAetherWithSemiColonModule() throws Throwable {
CmrRepository repository = createAetherRepository();
RepositoryManager manager = new SimpleRepositoryManager(repository, log);
ArtifactResult result = manager.getArtifactResult(MavenArtifactContext.NAMESPACE, "org.restlet.jse:org.restlet", "2.0.10");
Assert.assertNotNull(result);
File artifact = result.artifact();
boolean exists = false;
try {
Assert.assertNotNull(artifact);
Assert.assertTrue(artifact.exists());
exists = true;
List<ArtifactResult> deps = result.dependencies();
Assert.assertEquals(deps.size(), 1);
Assert.assertEquals("org.osgi:org.osgi.core", deps.get(0).name());
Assert.assertEquals("4.0.0", deps.get(0).version());
log.debug("deps = " + deps);
} finally {
if (exists) {
// delete this one
Assert.assertTrue(artifact.delete());
}
}
}
use of org.eclipse.ceylon.model.cmr.ArtifactResult in project ceylon by eclipse.
the class AetherTestCase method testScopes.
@Test
public void testScopes() throws Throwable {
CmrRepository repository = AetherRepository.createRepository(log, false, 60000);
RepositoryManager manager = new SimpleRepositoryManager(repository, log);
ArtifactResult artifact = manager.getArtifactResult(MavenArtifactContext.NAMESPACE, "org.jboss.xnio:xnio-api", "3.1.0.Beta7");
File file = null;
try {
Assert.assertNotNull(artifact);
file = artifact.artifact();
Assert.assertTrue(file.exists());
// http://search.maven.org/remotecontent?filepath=org/jboss/xnio/xnio-api/3.1.0.Beta7/xnio-api-3.1.0.Beta7.pom
// there should be org.jboss.logging:jboss-logging
Assert.assertTrue(artifact.dependencies().size() > 0);
} finally {
if (file != null && file.exists()) {
// delete this one
Assert.assertTrue(file.delete());
}
}
}
use of org.eclipse.ceylon.model.cmr.ArtifactResult in project ceylon by eclipse.
the class AetherTestCase method testAetherWithExternalSettings.
@Test
public void testAetherWithExternalSettings() throws Throwable {
CmrRepository repository = createAetherRepository();
RepositoryManager manager = new SimpleRepositoryManager(repository, log);
ArtifactResult result = manager.getArtifactResult(MavenArtifactContext.NAMESPACE, "org.apache.camel:camel-core", "2.9.2");
Assert.assertNotNull(result);
Assert.assertEquals(result.name(), "org.apache.camel:camel-core");
File artifact = result.artifact();
boolean exists = false;
try {
Assert.assertNotNull(artifact);
Assert.assertTrue(artifact.exists());
exists = true;
List<ArtifactResult> deps = result.dependencies();
log.debug("deps = " + deps);
List<ArtifactResult> compileDeps = new ArrayList<>(deps.size());
for (ArtifactResult dep : deps) {
if (dep.moduleScope() == ModuleScope.COMPILE || dep.moduleScope() == ModuleScope.PROVIDED)
compileDeps.add(dep);
}
Assert.assertEquals(2, compileDeps.size());
Assert.assertEquals("org.slf4j:slf4j-api", compileDeps.get(0).name());
Assert.assertEquals("1.6.1", compileDeps.get(0).version());
Assert.assertEquals("org.osgi:org.osgi.core", compileDeps.get(1).name());
Assert.assertEquals("4.2.0", compileDeps.get(1).version());
Assert.assertTrue(compileDeps.get(1).optional());
log.debug("deps = " + compileDeps);
} finally {
if (exists) {
// delete this one
Assert.assertTrue(artifact.delete());
}
}
}
use of org.eclipse.ceylon.model.cmr.ArtifactResult in project ceylon by eclipse.
the class AetherTestCase method testWithSources.
@Test
public void testWithSources() throws Throwable {
CmrRepository repository = AetherRepository.createRepository(log, false, 60000);
RepositoryManager manager = new SimpleRepositoryManager(repository, log);
ArtifactResult result = manager.getArtifactResult(new ArtifactContext(MavenRepository.NAMESPACE, "org.slf4j:slf4j-api", "1.6.4", ArtifactContext.LEGACY_SRC));
Assert.assertNotNull(result);
File artifact = result.artifact();
boolean exists = false;
try {
Assert.assertNotNull(artifact);
Assert.assertTrue(artifact.exists());
exists = true;
} finally {
if (exists) {
// delete this one
Assert.assertTrue(artifact.delete());
}
}
}
Aggregations