Search in sources :

Example 56 with RepositoryManager

use of org.eclipse.ceylon.cmr.api.RepositoryManager in project ceylon by eclipse.

the class SmokeTestCase method testCompleteStopAtVersion.

@Test
public void testCompleteStopAtVersion() throws Exception {
    RepositoryManager manager = getRepositoryManager();
    ModuleDetails[] expected = new ModuleDetails[] {};
    testComplete("com.acme.helloworld.", expected, manager);
}
Also used : RepositoryManager(org.eclipse.ceylon.cmr.api.RepositoryManager) SimpleRepositoryManager(org.eclipse.ceylon.cmr.impl.SimpleRepositoryManager) ModuleDetails(org.eclipse.ceylon.cmr.api.ModuleSearchResult.ModuleDetails) Test(org.junit.Test)

Example 57 with RepositoryManager

use of org.eclipse.ceylon.cmr.api.RepositoryManager in project ceylon by eclipse.

the class SmokeTestCase method testCompleteOrg.

@Test
public void testCompleteOrg() throws Exception {
    RepositoryManager manager = getRepositoryManager();
    ModuleDetails[] expected = new ModuleDetails[] { com_acme_helloworld };
    testComplete("com", expected, manager);
}
Also used : RepositoryManager(org.eclipse.ceylon.cmr.api.RepositoryManager) SimpleRepositoryManager(org.eclipse.ceylon.cmr.impl.SimpleRepositoryManager) ModuleDetails(org.eclipse.ceylon.cmr.api.ModuleSearchResult.ModuleDetails) Test(org.junit.Test)

Example 58 with RepositoryManager

use of org.eclipse.ceylon.cmr.api.RepositoryManager in project ceylon by eclipse.

the class SmokeTestCase method testSearchJDKModulesPaged.

@Test
public void testSearchJDKModulesPaged() throws Exception {
    Assume.assumeTrue(JDKUtils.jdk == JDKUtils.JDK.JDK8);
    RepositoryManager repoManager = getJDKRepositoryManager();
    // first page
    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") };
    ModuleSearchResult results = testSearchResults("", Type.JVM, expected, 0l, 20l, repoManager);
    Assert.assertEquals(20, results.getCount());
    Assert.assertEquals(true, results.getHasMoreResults());
    Assert.assertEquals(0, results.getStart());
    // second page
    expected = new ModuleDetails[] { 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") };
    results = testSearchResults("", Type.JVM, expected, results.getStart() + results.getCount(), 20l, repoManager, results.getNextPagingInfo());
    Assert.assertEquals(20, results.getCount());
    Assert.assertEquals(true, results.getHasMoreResults());
    Assert.assertEquals(20, results.getStart());
    // third page
    expected = new ModuleDetails[] { 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") };
    results = testSearchResults("", Type.JVM, expected, results.getStart() + results.getCount(), 20l, repoManager, results.getNextPagingInfo());
    Assert.assertEquals(16, results.getCount());
    Assert.assertEquals(false, results.getHasMoreResults());
    Assert.assertEquals(40, results.getStart());
}
Also used : RepositoryManager(org.eclipse.ceylon.cmr.api.RepositoryManager) SimpleRepositoryManager(org.eclipse.ceylon.cmr.impl.SimpleRepositoryManager) ModuleDetails(org.eclipse.ceylon.cmr.api.ModuleSearchResult.ModuleDetails) ModuleSearchResult(org.eclipse.ceylon.cmr.api.ModuleSearchResult) Test(org.junit.Test)

Example 59 with RepositoryManager

use of org.eclipse.ceylon.cmr.api.RepositoryManager in project ceylon by eclipse.

the class SmokeTestCase method testCompleteHello2JSNewModel.

@Test
public void testCompleteHello2JSNewModel() throws Exception {
    RepositoryManager manager = getRepositoryManager();
    ModuleDetails[] expected = new ModuleDetails[] { hello2_js };
    testComplete("hello2", expected, manager, ModuleQuery.Type.JS);
}
Also used : RepositoryManager(org.eclipse.ceylon.cmr.api.RepositoryManager) SimpleRepositoryManager(org.eclipse.ceylon.cmr.impl.SimpleRepositoryManager) ModuleDetails(org.eclipse.ceylon.cmr.api.ModuleSearchResult.ModuleDetails) Test(org.junit.Test)

Example 60 with RepositoryManager

use of org.eclipse.ceylon.cmr.api.RepositoryManager in project ceylon by eclipse.

the class SmokeTestCase method testOverridesInterpolation.

@Test
public void testOverridesInterpolation() throws Exception {
    RepositoryManager manager = getRepositoryManager("testsuite/src/test/resources/overridesInterpolation.xml");
    ArtifactResult result = manager.getArtifactResult(null, "moduletest", "0.1");
    Assert.assertNotNull(result);
    Assert.assertEquals(2, result.dependencies().size());
}
Also used : RepositoryManager(org.eclipse.ceylon.cmr.api.RepositoryManager) SimpleRepositoryManager(org.eclipse.ceylon.cmr.impl.SimpleRepositoryManager) ArtifactResult(org.eclipse.ceylon.model.cmr.ArtifactResult) Test(org.junit.Test)

Aggregations

RepositoryManager (org.eclipse.ceylon.cmr.api.RepositoryManager)95 Test (org.junit.Test)71 SimpleRepositoryManager (org.eclipse.ceylon.cmr.impl.SimpleRepositoryManager)68 File (java.io.File)47 ArtifactResult (org.eclipse.ceylon.model.cmr.ArtifactResult)32 CmrRepository (org.eclipse.ceylon.cmr.api.CmrRepository)26 ArtifactContext (org.eclipse.ceylon.cmr.api.ArtifactContext)23 ModuleDetails (org.eclipse.ceylon.cmr.api.ModuleSearchResult.ModuleDetails)14 TypeCheckerBuilder (org.eclipse.ceylon.compiler.typechecker.TypeCheckerBuilder)11 RepositoryManagerBuilder (org.eclipse.ceylon.cmr.api.RepositoryManagerBuilder)8 HashMap (java.util.HashMap)7 TypeChecker (org.eclipse.ceylon.compiler.typechecker.TypeChecker)7 ByteArrayInputStream (java.io.ByteArrayInputStream)5 ArrayList (java.util.ArrayList)5 JsModuleManagerFactory (org.eclipse.ceylon.compiler.js.loader.JsModuleManagerFactory)5 ModuleSearchResult (org.eclipse.ceylon.cmr.api.ModuleSearchResult)4 CeylonRepoManagerBuilder (org.eclipse.ceylon.cmr.ceylon.CeylonUtils.CeylonRepoManagerBuilder)4 IOException (java.io.IOException)3 Manifest (java.util.jar.Manifest)3 DefaultRepository (org.eclipse.ceylon.cmr.impl.DefaultRepository)3