use of org.eclipse.ceylon.cmr.api.ArtifactContext in project ceylon by eclipse.
the class SmokeTestCase method testSharedOSGi.
@Test
public void testSharedOSGi() throws Exception {
RepositoryManager manager = getRepositoryManager();
ArtifactContext context = new ArtifactContext(null, "org.osgi.ceylon.shared", "1.0", ArtifactContext.JAR);
try {
Manifest manifest = mockManifest("1.0");
manifest.getMainAttributes().putValue("Require-Bundle", "moduletest;visibility:=reexport;bundle-version=0.1");
manager.putArtifact(context, mockJar("foo", "bar".getBytes(), manifest));
ArtifactResult result = manager.getArtifactResult(context);
Assert.assertNotNull(result);
Assert.assertNotNull(result.dependencies());
Assert.assertEquals(1, result.dependencies().size());
ArtifactResult dep1 = result.dependencies().get(0);
Assert.assertNotNull(dep1);
Assert.assertTrue(dep1.exported());
} finally {
manager.removeArtifact(context);
}
}
use of org.eclipse.ceylon.cmr.api.ArtifactContext 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.ArtifactContext 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);
}
use of org.eclipse.ceylon.cmr.api.ArtifactContext 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);
}
}
use of org.eclipse.ceylon.cmr.api.ArtifactContext 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);
}
Aggregations