use of org.eclipse.ceylon.cmr.api.RepositoryManager in project ceylon by eclipse.
the class SmokeTestCase method testNavigation.
@Test
public void testNavigation() throws Exception {
RepositoryManager manager = getRepositoryManager();
File acme = manager.getArtifact(null, "org.jboss.acme", "1.0.0.Final");
Assert.assertNotNull("Module 'org.jboss.acme-1.0.0.Final' not found", acme);
}
use of org.eclipse.ceylon.cmr.api.RepositoryManager in project ceylon by eclipse.
the class SmokeTestCase method testOverridesReplaceImport.
@Test
public void testOverridesReplaceImport() throws Exception {
RepositoryManager manager = getRepositoryManager("testsuite/src/test/resources/overridesReplaceImport.xml");
ArtifactResult result = manager.getArtifactResult(null, "moduletest", "0.1");
Assert.assertNotNull(result);
Assert.assertEquals(2, result.dependencies().size());
ArtifactResult dep = result.dependencies().get(1);
Assert.assertEquals("com.acme.helloworld", dep.name());
Assert.assertEquals("1.0.0", dep.version());
Assert.assertEquals(1, dep.dependencies().size());
}
use of org.eclipse.ceylon.cmr.api.RepositoryManager in project ceylon by eclipse.
the class SmokeTestCase method testGetMultiple.
@Test
public void testGetMultiple() 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 artifact = new ArtifactContext(null, "ceylon.json", "1.0.0", ArtifactContext.CAR, ArtifactContext.SCRIPTS_ZIPPED, ArtifactContext.JS);
List<ArtifactResult> json = manager.getArtifactResults(artifact);
Assert.assertNotNull("Module 'ceylon.json-1.0.0' not found", json);
Assert.assertEquals("Expected two artifacts for 'ceylon.json-1.0.0'", 2, json.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());
}
use of org.eclipse.ceylon.cmr.api.RepositoryManager in project ceylon by eclipse.
the class SmokeTestCase method testRemoteContent.
@Test
public void testRemoteContent() throws Exception {
String repoURL = "http://jboss-as7-modules-repository.googlecode.com/svn/trunk/ceylon";
try {
new URL(repoURL).openStream();
} catch (Exception e) {
log.error(String.format("Cannot connect to repo %s - %s", repoURL, e));
// probably not on the internet?
return;
}
RepositoryManagerBuilder builder = getRepositoryManagerBuilder(false, 60000, java.net.Proxy.NO_PROXY);
RemoteContentStore rcs = new RemoteContentStore(repoURL, log, false, 60000, java.net.Proxy.NO_PROXY);
CmrRepository repo = new DefaultRepository(rcs.createRoot());
RepositoryManager manager = builder.addRepository(repo).buildRepository();
String name = "org.eclipse.fizbiz";
String version = "1.0.0.Beta1";
File file = null;
File originFile = null;
try {
file = manager.getArtifact(null, name, version);
Assert.assertNotNull(file);
originFile = new File(file.getAbsolutePath() + ".origin");
Assert.assertNotNull(originFile);
try {
String line;
try (BufferedReader reader = new BufferedReader(new FileReader(originFile))) {
line = reader.readLine();
}
assertEquals(repoURL, line);
} catch (IOException ignored) {
}
} finally {
manager.removeArtifact(null, name, version);
// test if remove really works
if (file != null)
assertFalse(file.exists());
if (originFile != null)
assertFalse(originFile.exists());
testSearchResults("org.eclipse.fizbiz", Type.JVM, new ModuleDetails[0]);
}
}
use of org.eclipse.ceylon.cmr.api.RepositoryManager in project ceylon by eclipse.
the class SmokeTestCase method testCompleteJDK.
@Test
public void testCompleteJDK() throws Exception {
Assume.assumeTrue(JDKUtils.jdk == JDKUtils.JDK.JDK8);
RepositoryManager manager = getJDKRepositoryManager();
ModuleDetails[] expected = new ModuleDetails[] { jdkModule("java.auth", "JDK module java.auth"), jdkModule("java.auth.kerberos", "JDK module java.auth.kerberos"), jdkModule("java.base", "JDK module java.base"), jdkModule("java.compiler", "JDK module java.compiler"), jdkModule("java.corba", "JDK module java.corba"), jdkModule("java.desktop", "JDK module java.desktop"), jdkModule("java.instrument", "JDK module java.instrument"), jdkModule("java.jdbc", "JDK module java.jdbc"), jdkModule("java.jdbc.rowset", "JDK module java.jdbc.rowset"), jdkModule("java.logging", "JDK module java.logging"), jdkModule("java.management", "JDK module java.management"), jdkModule("java.prefs", "JDK module java.prefs"), jdkModule("java.rmi", "JDK module java.rmi"), jdkModule("java.security.acl", "JDK module java.security.acl"), jdkModule("java.tls", "JDK module java.tls"), jdkModule("javafx.base", "JDK module javafx.base"), jdkModule("javafx.controls", "JDK module javafx.controls"), jdkModule("javafx.deploy", "JDK module javafx.deploy"), jdkModule("javafx.fxml", "JDK module javafx.fxml"), jdkModule("javafx.graphics", "JDK module javafx.graphics"), jdkModule("javafx.media", "JDK module javafx.media"), jdkModule("javafx.swing", "JDK module javafx.swing"), jdkModule("javafx.web", "JDK module javafx.web"), jdkModule("javax.annotation", "JDK module javax.annotation"), jdkModule("javax.jaxws", "JDK module javax.jaxws"), jdkModule("javax.naming", "JDK module javax.naming"), jdkModule("javax.script", "JDK module javax.script"), jdkModule("javax.transaction", "JDK module javax.transaction"), jdkModule("javax.xml", "JDK module javax.xml"), jdkModule("javax.xmldsig", "JDK module javax.xmldsig"), jdkModule("oracle.jdk.auth", "JDK module oracle.jdk.auth"), jdkModule("oracle.jdk.base", "JDK module oracle.jdk.base"), jdkModule("oracle.jdk.compat", "JDK module oracle.jdk.compat"), jdkModule("oracle.jdk.corba", "JDK module oracle.jdk.corba"), jdkModule("oracle.jdk.cosnaming", "JDK module oracle.jdk.cosnaming"), jdkModule("oracle.jdk.deploy", "JDK module oracle.jdk.deploy"), jdkModule("oracle.jdk.desktop", "JDK module oracle.jdk.desktop"), jdkModule("oracle.jdk.httpserver", "JDK module oracle.jdk.httpserver"), jdkModule("oracle.jdk.instrument", "JDK module oracle.jdk.instrument"), jdkModule("oracle.jdk.jaxp", "JDK module oracle.jdk.jaxp"), jdkModule("oracle.jdk.jaxws", "JDK module oracle.jdk.jaxws"), jdkModule("oracle.jdk.jdbc.rowset", "JDK module oracle.jdk.jdbc.rowset"), jdkModule("oracle.jdk.jndi", "JDK module oracle.jdk.jndi"), jdkModule("oracle.jdk.logging", "JDK module oracle.jdk.logging"), jdkModule("oracle.jdk.management", "JDK module oracle.jdk.management"), jdkModule("oracle.jdk.management.iiop", "JDK module oracle.jdk.management.iiop"), jdkModule("oracle.jdk.rmi", "JDK module oracle.jdk.rmi"), jdkModule("oracle.jdk.scripting", "JDK module oracle.jdk.scripting"), jdkModule("oracle.jdk.sctp", "JDK module oracle.jdk.sctp"), jdkModule("oracle.jdk.security.acl", "JDK module oracle.jdk.security.acl"), jdkModule("oracle.jdk.smartcardio", "JDK module oracle.jdk.smartcardio"), jdkModule("oracle.jdk.tools.base", "JDK module oracle.jdk.tools.base"), jdkModule("oracle.jdk.tools.jaxws", "JDK module oracle.jdk.tools.jaxws"), jdkModule("oracle.jdk.tools.jre", "JDK module oracle.jdk.tools.jre"), jdkModule("oracle.jdk.xmldsig", "JDK module oracle.jdk.xmldsig"), jdkModule("oracle.sun.charsets", "JDK module oracle.sun.charsets") };
testComplete("", expected, manager);
}
Aggregations