use of org.eclipse.ceylon.cmr.api.RepositoryManager in project ceylon by eclipse.
the class SmokeTestCase method testPropertiesPut.
@Test
public void testPropertiesPut() throws Exception {
RepositoryManager manager = getRepositoryManager();
ArtifactContext context = new ArtifactContext(null, "org.acme.props", "1.0", ArtifactContext.JAR);
try {
manager.putArtifact(context, mockJar("someentry", "qwerty".getBytes()));
manager.putArtifact(context.getModuleProperties(), new ByteArrayInputStream("moduletest=0.1\n".getBytes()));
File file = manager.getArtifact(context);
Assert.assertNotNull(file);
} finally {
manager.removeArtifact(context);
}
}
use of org.eclipse.ceylon.cmr.api.RepositoryManager in project ceylon by eclipse.
the class SmokeTestCase method testCompleteJDKWithPrefix.
@Test
public void testCompleteJDKWithPrefix() 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") };
testComplete("java", expected, manager);
expected = new ModuleDetails[] { 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") };
testComplete("javax", expected, manager);
}
use of org.eclipse.ceylon.cmr.api.RepositoryManager in project ceylon by eclipse.
the class SmokeTestCase method testForcedPut.
@Test
public void testForcedPut() throws Exception {
RepositoryManager manager = getRepositoryManager();
ByteArrayInputStream baos = new ByteArrayInputStream("qwerty".getBytes());
String name = "org.eclipse.foobar2";
String version = "1.0.0.Alpha1";
try {
ArtifactContext context = new ArtifactContext();
context.setName(name);
context.setVersion(version);
context.setForceOperation(true);
manager.putArtifact(context, baos);
File file = manager.getArtifact(null, name, version);
Assert.assertNotNull("Failed to retrieve after put", file);
baos = new ByteArrayInputStream("ytrewq".getBytes());
manager.putArtifact(context, baos);
file = manager.getArtifact(null, name, version);
Assert.assertNotNull("Failed to retrieve after forced put", file);
} finally {
manager.removeArtifact(null, name, version);
}
}
use of org.eclipse.ceylon.cmr.api.RepositoryManager in project ceylon by eclipse.
the class SmokeTestCase method testRemove.
@Test
public void testRemove() throws Exception {
RepositoryManager manager = getRepositoryManager();
String name = "org.jboss.qwerty";
String version = "1.0.0.Alpha2";
File file = null;
try {
File artifact = manager.getArtifact(null, name, version);
Assert.assertNull(artifact);
manager.putArtifact(null, name, version, new ByteArrayInputStream("qwerty".getBytes()));
file = manager.getArtifact(null, name, version);
Assert.assertNotNull("Failed to retrieve after put", file);
} finally {
manager.removeArtifact(null, name, version);
if (file != null)
Assert.assertFalse("Failed to remove module", file.exists());
}
}
use of org.eclipse.ceylon.cmr.api.RepositoryManager in project ceylon by eclipse.
the class SmokeTestCase method testNoVersion.
@Test
public void testNoVersion() throws Exception {
RepositoryManager manager = getRepositoryManager();
File def = manager.getArtifact(null, RepositoryManager.DEFAULT_MODULE, null);
Assert.assertNotNull("Default module not found", def);
}
Aggregations