Search in sources :

Example 6 with CeylonInfoTool

use of org.eclipse.ceylon.tools.info.CeylonInfoTool in project ceylon by eclipse.

the class InfoToolTests method testModuleOnly.

@Test
public void testModuleOnly() throws Exception {
    ToolModel<CeylonInfoTool> model = pluginLoader.loadToolModel("info");
    Assert.assertNotNull(model);
    CeylonInfoTool tool = pluginFactory.bindArguments(model, getMainTool(), Collections.<String>singletonList("ceylon.language"));
    tool.run();
}
Also used : CeylonInfoTool(org.eclipse.ceylon.tools.info.CeylonInfoTool) Test(org.junit.Test)

Example 7 with CeylonInfoTool

use of org.eclipse.ceylon.tools.info.CeylonInfoTool in project ceylon by eclipse.

the class InfoToolTests method testOptionalDependencies.

@Test
public void testOptionalDependencies() throws Exception {
    ToolModel<CeylonInfoTool> model = pluginLoader.loadToolModel("info");
    Assert.assertNotNull(model);
    CeylonInfoTool tool = pluginFactory.bindArguments(model, getMainTool(), Arrays.asList("org.hibernate:hibernate-validator/5.3.0.Final"));
    StringBuilder b = new StringBuilder();
    tool.setOut(b);
    tool.run();
    Assert.assertTrue(b.toString().contains("joda-time"));
}
Also used : CeylonInfoTool(org.eclipse.ceylon.tools.info.CeylonInfoTool) Test(org.junit.Test)

Example 8 with CeylonInfoTool

use of org.eclipse.ceylon.tools.info.CeylonInfoTool in project ceylon by eclipse.

the class InfoToolTests method testAetherModuleVersions.

@Test
public void testAetherModuleVersions() throws Exception {
    ToolModel<CeylonInfoTool> model = pluginLoader.loadToolModel("info");
    Assert.assertNotNull(model);
    CeylonInfoTool tool = pluginFactory.bindArguments(model, getMainTool(), Collections.<String>singletonList("maven:asm:asm-commons"));
    StringBuilder b = new StringBuilder();
    tool.setOut(b);
    tool.run();
    Assert.assertTrue(b.toString().replace(System.lineSeparator(), "\n").contains("maven:asm:asm-commons/2.0\n" + "maven:asm:asm-commons/2.1\n" + "maven:asm:asm-commons/2.2\n" + "maven:asm:asm-commons/2.2.1\n" + "maven:asm:asm-commons/3.0\n" + "maven:asm:asm-commons/3.1\n" + "maven:asm:asm-commons/3.2\n" + "maven:asm:asm-commons/3.3\n" + "maven:asm:asm-commons/3.3.1"));
}
Also used : CeylonInfoTool(org.eclipse.ceylon.tools.info.CeylonInfoTool) Test(org.junit.Test)

Example 9 with CeylonInfoTool

use of org.eclipse.ceylon.tools.info.CeylonInfoTool in project ceylon by eclipse.

the class InfoToolTests method testSuggestOverride.

@Test
public void testSuggestOverride() throws Exception {
    ToolModel<CeylonInfoTool> model = pluginLoader.loadToolModel("info");
    Assert.assertNotNull(model);
    CeylonInfoTool tool = pluginFactory.bindArguments(model, getMainTool(), Arrays.asList("--dependency-depth=-1", "--show-incompatible=yes", "--print-overrides", "io.cayla.web/0.3.0"));
    StringBuilder b = new StringBuilder();
    tool.setOut(b);
    tool.run();
    Assert.assertTrue(b.toString().contains("<overrides>\n" + " <set module=\"org.jboss.logging\" version=\"3.1.3.GA\"/>\n" + "</overrides>\n"));
}
Also used : CeylonInfoTool(org.eclipse.ceylon.tools.info.CeylonInfoTool) Test(org.junit.Test)

Example 10 with CeylonInfoTool

use of org.eclipse.ceylon.tools.info.CeylonInfoTool in project ceylon by eclipse.

the class InfoToolTests method testNoArgs.

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

Aggregations

CeylonInfoTool (org.eclipse.ceylon.tools.info.CeylonInfoTool)13 Test (org.junit.Test)13 OptionArgumentException (org.eclipse.ceylon.common.tool.OptionArgumentException)1