use of org.eclipse.ceylon.cmr.api.RepositoryManager in project ceylon by eclipse.
the class SmokeTestCase method testOverridesSet.
@Test
public void testOverridesSet() throws Exception {
RepositoryManager manager = getRepositoryManager();
ArtifactResult result = manager.getArtifactResult(null, "moduletest", "0.1");
Assert.assertNotNull(result);
manager = getRepositoryManager("testsuite/src/test/resources/overridesSet.xml");
result = manager.getArtifactResult(null, "moduletest", "0.1");
Assert.assertNull(result);
}
use of org.eclipse.ceylon.cmr.api.RepositoryManager in project ceylon by eclipse.
the class SmokeTestCase method testCompleteJDKOnJS.
@Test
public void testCompleteJDKOnJS() throws Exception {
RepositoryManager manager = getJDKRepositoryManager();
ModuleDetails[] expected = new ModuleDetails[] {};
testComplete("", expected, manager, ModuleQuery.Type.JS);
}
use of org.eclipse.ceylon.cmr.api.RepositoryManager 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.RepositoryManager 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.RepositoryManager in project ceylon by eclipse.
the class SmokeTestCase method testSearchModulesPaged.
@Test
public void testSearchModulesPaged() throws Exception {
RepositoryManager repoManager = getRepositoryManager();
// first page
ModuleDetails[] expected = new ModuleDetails[] { com_acme_helloworld, hello };
ModuleSearchResult results = testSearchResults("", Type.JVM, expected, 0l, 2l, repoManager);
Assert.assertEquals(2, results.getCount());
Assert.assertEquals(true, results.getHasMoreResults());
Assert.assertEquals(0, results.getStart());
// second page
expected = new ModuleDetails[] { hello2_jvm, moduletest, old_jar };
results = testSearchResults("", Type.JVM, expected, results.getStart() + results.getCount(), 3l, repoManager, results.getNextPagingInfo());
Assert.assertEquals(3, results.getCount());
Assert.assertEquals(true, results.getHasMoreResults());
Assert.assertEquals(2, results.getStart());
// third page
expected = new ModuleDetails[] { older_jar, test_jar };
results = testSearchResults("", Type.JVM, expected, results.getStart() + results.getCount(), 2l, repoManager, results.getNextPagingInfo());
Assert.assertEquals(2, results.getCount());
Assert.assertEquals(false, results.getHasMoreResults());
Assert.assertEquals(5, results.getStart());
}
Aggregations