Search in sources :

Example 6 with CeylonClasspathTool

use of com.redhat.ceylon.tools.classpath.CeylonClasspathTool in project ceylon-compiler by ceylon.

the class ClasspathToolTests method testRecursiveDependenciesForce.

@Test
public void testRecursiveDependenciesForce() throws Exception {
    ToolModel<CeylonClasspathTool> model = pluginLoader.loadToolModel("classpath");
    Assert.assertNotNull(model);
    CeylonClasspathTool tool = pluginFactory.bindArguments(model, getMainTool(), Arrays.asList("--force", "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(com.redhat.ceylon.tools.classpath.CeylonClasspathTool) Test(org.junit.Test)

Example 7 with CeylonClasspathTool

use of com.redhat.ceylon.tools.classpath.CeylonClasspathTool in project ceylon-compiler by ceylon.

the class ClasspathToolTests method testNoArgs.

@Test
public void testNoArgs() throws Exception {
    ToolModel<CeylonClasspathTool> model = pluginLoader.loadToolModel("classpath");
    Assert.assertNotNull(model);
    try {
        CeylonClasspathTool tool = pluginFactory.bindArguments(model, getMainTool(), Collections.<String>emptyList());
        Assert.fail();
    } catch (OptionArgumentException e) {
    // asserting this is thrown
    }
}
Also used : OptionArgumentException(com.redhat.ceylon.common.tool.OptionArgumentException) CeylonClasspathTool(com.redhat.ceylon.tools.classpath.CeylonClasspathTool) Test(org.junit.Test)

Example 8 with CeylonClasspathTool

use of com.redhat.ceylon.tools.classpath.CeylonClasspathTool in project ceylon-compiler by ceylon.

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(), Collections.<String>singletonList("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(com.redhat.ceylon.common.tool.ToolUsageError) CeylonClasspathTool(com.redhat.ceylon.tools.classpath.CeylonClasspathTool) Test(org.junit.Test)

Aggregations

CeylonClasspathTool (com.redhat.ceylon.tools.classpath.CeylonClasspathTool)8 Test (org.junit.Test)7 ToolUsageError (com.redhat.ceylon.common.tool.ToolUsageError)2 OptionArgumentException (com.redhat.ceylon.common.tool.OptionArgumentException)1 ToolError (com.redhat.ceylon.common.tool.ToolError)1 Main (com.redhat.ceylon.compiler.java.runtime.Main)1