Search in sources :

Example 6 with CeylonClasspathTool

use of org.eclipse.ceylon.tools.classpath.CeylonClasspathTool in project ceylon by eclipse.

the class ClasspathToolTests method testNoOptionalModules.

@Test
public void testNoOptionalModules() throws Exception {
    ToolModel<CeylonClasspathTool> model = pluginLoader.loadToolModel("classpath");
    Assert.assertNotNull(model);
    CeylonClasspathTool tool = pluginFactory.bindArguments(model, getMainTool(), toolOptions("ceylon.language/" + Versions.CEYLON_VERSION_NUMBER));
    StringBuilder b = new StringBuilder();
    tool.setOut(b);
    tool.run();
    String cp = b.toString();
    Assert.assertTrue(cp.contains("ceylon.language-" + Versions.CEYLON_VERSION_NUMBER + ".car"));
    Assert.assertFalse(cp.contains("minidev"));
    // Assert.assertFalse(cp.contains("maven"));
    Assert.assertFalse(cp.contains("aether"));
// Assert.assertFalse(cp.contains("plexus"));
}
Also used : CeylonClasspathTool(org.eclipse.ceylon.tools.classpath.CeylonClasspathTool) Test(org.junit.Test)

Example 7 with CeylonClasspathTool

use of org.eclipse.ceylon.tools.classpath.CeylonClasspathTool in project ceylon by eclipse.

the class ClasspathToolTests method testModuleNameWithBadVersion.

@Test
public void testModuleNameWithBadVersion() throws Exception {
    ToolModel<CeylonClasspathTool> model = pluginLoader.loadToolModel("classpath");
    Assert.assertNotNull(model);
    CeylonClasspathTool tool = pluginFactory.bindArguments(model, getMainTool(), toolOptions("ceylon.language/666"));
    try {
        tool.run();
    } catch (ToolUsageError x) {
        Assert.assertTrue(x.getMessage().contains("Version 666 not found for module ceylon.language"));
    }
}
Also used : ToolUsageError(org.eclipse.ceylon.common.tool.ToolUsageError) CeylonClasspathTool(org.eclipse.ceylon.tools.classpath.CeylonClasspathTool) Test(org.junit.Test)

Example 8 with CeylonClasspathTool

use of org.eclipse.ceylon.tools.classpath.CeylonClasspathTool in project ceylon by eclipse.

the class ClasspathToolTests method testRecursiveDependenciesOverride.

@Ignore("Disabled due to backward compat break")
@Test
public void testRecursiveDependenciesOverride() throws Exception {
    ToolModel<CeylonClasspathTool> model = pluginLoader.loadToolModel("classpath");
    Assert.assertNotNull(model);
    CeylonClasspathTool tool = pluginFactory.bindArguments(model, getMainTool(), toolOptions("--overrides", getPackagePath() + "/overrides.xml", "io.cayla.web/0.3.0"));
    StringBuilder b = new StringBuilder();
    tool.setOut(b);
    tool.run();
    String cp = b.toString();
    Assert.assertTrue(cp.contains("org.jboss.logging-3.1.3.GA.jar"));
    Assert.assertFalse(cp.contains("org.jboss.logging-3.1.2.GA.jar"));
}
Also used : CeylonClasspathTool(org.eclipse.ceylon.tools.classpath.CeylonClasspathTool) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 9 with CeylonClasspathTool

use of org.eclipse.ceylon.tools.classpath.CeylonClasspathTool in project ceylon by eclipse.

the class ClasspathToolTests method testWithOptionalModules.

@Test
public void testWithOptionalModules() throws Exception {
    ToolModel<CeylonClasspathTool> model = pluginLoader.loadToolModel("classpath");
    Assert.assertNotNull(model);
    CeylonClasspathTool tool = pluginFactory.bindArguments(model, getMainTool(), toolOptions("ceylon.language/" + Versions.CEYLON_VERSION_NUMBER, "org.eclipse.ceylon.module-resolver-aether/" + Versions.CEYLON_VERSION_NUMBER));
    StringBuilder b = new StringBuilder();
    tool.setOut(b);
    tool.run();
    String cp = b.toString();
    Assert.assertTrue(cp.contains("ceylon.language-" + Versions.CEYLON_VERSION_NUMBER + ".car"));
    Assert.assertFalse(cp.contains("minidev"));
    // Assert.assertTrue(cp.contains("maven"));
    Assert.assertTrue(cp.contains("aether"));
// Assert.assertTrue(cp.contains("plexus"));
}
Also used : CeylonClasspathTool(org.eclipse.ceylon.tools.classpath.CeylonClasspathTool) Test(org.junit.Test)

Aggregations

CeylonClasspathTool (org.eclipse.ceylon.tools.classpath.CeylonClasspathTool)9 Test (org.junit.Test)8 ToolUsageError (org.eclipse.ceylon.common.tool.ToolUsageError)2 ArrayList (java.util.ArrayList)1 OptionArgumentException (org.eclipse.ceylon.common.tool.OptionArgumentException)1 ToolError (org.eclipse.ceylon.common.tool.ToolError)1 Ignore (org.junit.Ignore)1