use of org.eclipse.ceylon.cmr.impl.SimpleRepositoryManager in project ceylon by eclipse.
the class ResolverTestCase method doTest.
private void doTest(Tester tester) throws Exception {
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;
tester.run(repository, artifact);
} finally {
if (exists) {
// delete this one
Assert.assertTrue(artifact.delete());
}
}
}
use of org.eclipse.ceylon.cmr.impl.SimpleRepositoryManager in project ceylon by eclipse.
the class ModuleLoaderTest method testNoDots.
@Test
public void testNoDots() throws ModuleNotFoundException {
CmrRepository repository = AetherRepository.createRepository(log, false, 60000);
RepositoryManager manager = new SimpleRepositoryManager(repository, log);
Map<String, String> extraModules = new HashMap<>();
extraModules.put("maven:aopalliance:aopalliance", "1.0");
TestableModuleLoader moduleLoader = new TestableModuleLoader(manager, null, extraModules, true);
// org.antlr:stringtemplate:3.2.1
// com.google.inject:guice:4.0
moduleLoader.loadModule("maven:antlr:antlr", "2.7.7", ModuleScope.RUNTIME);
// Check that we got them
Assert.assertEquals("2.7.7", moduleLoader.getModuleVersion("maven:antlr:antlr"));
Assert.assertEquals("1.0", moduleLoader.getModuleVersion("maven:aopalliance:aopalliance"));
}
use of org.eclipse.ceylon.cmr.impl.SimpleRepositoryManager in project ceylon by eclipse.
the class ModuleLoaderTest method testNoDotsFromMaven.
@Test
public void testNoDotsFromMaven() throws ModuleNotFoundException {
CmrRepository repository = AetherRepository.createRepository(log, false, 60000);
RepositoryManager manager = new SimpleRepositoryManager(repository, log);
Map<String, String> extraModules = new HashMap<>();
extraModules.put("org.antlr:stringtemplate", "3.2.1");
TestableModuleLoader moduleLoader = new TestableModuleLoader(manager, null, extraModules, true);
moduleLoader.loadModule("com.google.inject:guice", "4.0", ModuleScope.RUNTIME);
// Check that we got them
Assert.assertEquals("2.7.7", moduleLoader.getModuleVersion("maven:antlr:antlr"));
Assert.assertEquals("1.0", moduleLoader.getModuleVersion("maven:aopalliance:aopalliance"));
}
use of org.eclipse.ceylon.cmr.impl.SimpleRepositoryManager in project ceylon by eclipse.
the class ModuleLoaderTest method testModuleLoaderDirectImportsNotExcluded.
@Test
public void testModuleLoaderDirectImportsNotExcluded() throws ModuleNotFoundException {
CmrRepository repository = AetherRepository.createRepository(log, settings, false, 60000, null);
RepositoryManager manager = new SimpleRepositoryManager(repository, log);
Map<String, String> extraModules = new HashMap<>();
extraModules.put("org.springframework.cloud:spring-cloud-starter-eureka-server", "1.1.0.RC1");
TestableModuleLoader moduleLoader = new TestableModuleLoader(manager, null, extraModules, false);
moduleLoader.loadModule("org.springframework.cloud:spring-cloud-starter-eureka-server", "1.1.0.RC1", ModuleScope.RUNTIME);
// Those should not be there
Assert.assertNull(moduleLoader.getModuleVersion("jackson-dataformat-xml:com.fasterxml.jackson.dataformat"));
moduleLoader.cleanup();
// now add a direct import
moduleLoader.loadModule("com.fasterxml.jackson.dataformat:jackson-dataformat-xml", "2.6.5", ModuleScope.RUNTIME);
// Should be there
Assert.assertEquals("2.6.5", moduleLoader.getModuleVersion("com.fasterxml.jackson.dataformat:jackson-dataformat-xml"));
}
Aggregations