Search in sources :

Example 6 with CeylonInfoTool

use of com.redhat.ceylon.tools.info.CeylonInfoTool in project ceylon-compiler by ceylon.

the class InfoToolTests method testAetherModule.

@Test
public void testAetherModule() throws Exception {
    ToolModel<CeylonInfoTool> model = pluginLoader.loadToolModel("info");
    Assert.assertNotNull(model);
    CeylonInfoTool tool = pluginFactory.bindArguments(model, getMainTool(), Arrays.asList("--dependency-depth=-1", "com.sparkjava:spark-core/2.1"));
    StringBuilder b = new StringBuilder();
    tool.setOut(b);
    tool.run();
    Assert.assertTrue(b.toString().contains("Dependencies (up to depth ∞):\n" + "  org.eclipse.jetty.orbit:javax.servlet/3.0.0.v201112011016\n" + "  org.eclipse.jetty:jetty-http/9.0.2.v20130417\n" + "  org.eclipse.jetty:jetty-io/9.0.2.v20130417\n" + "  org.eclipse.jetty:jetty-security/9.0.2.v20130417\n" + "  org.eclipse.jetty:jetty-server/9.0.2.v20130417\n" + "  org.eclipse.jetty:jetty-servlet/9.0.2.v20130417\n" + "  org.eclipse.jetty:jetty-util/9.0.2.v20130417\n" + "  org.eclipse.jetty:jetty-webapp/9.0.2.v20130417\n" + "  org.eclipse.jetty:jetty-xml/9.0.2.v20130417\n" + "  org.slf4j:slf4j-api/1.7.7\n" + "  org.slf4j:slf4j-simple/1.7.7\n"));
}
Also used : CeylonInfoTool(com.redhat.ceylon.tools.info.CeylonInfoTool) Test(org.junit.Test)

Example 7 with CeylonInfoTool

use of com.redhat.ceylon.tools.info.CeylonInfoTool in project ceylon-compiler by ceylon.

the class InfoToolTests method testOffline.

@Test
public void testOffline() throws Exception {
    ToolModel<CeylonInfoTool> model = pluginLoader.loadToolModel("info");
    Assert.assertNotNull(model);
    CeylonInfoTool tool = pluginFactory.bindArguments(model, getMainTool(), Arrays.<String>asList("--offline", "ceylon.language"));
}
Also used : CeylonInfoTool(com.redhat.ceylon.tools.info.CeylonInfoTool) Test(org.junit.Test)

Example 8 with CeylonInfoTool

use of com.redhat.ceylon.tools.info.CeylonInfoTool in project ceylon-compiler by ceylon.

the class InfoToolTests method testRecursiveDependencies.

@Test
public void testRecursiveDependencies() 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", "io.cayla.web/0.3.0"));
    StringBuilder b = new StringBuilder();
    tool.setOut(b);
    tool.run();
    Assert.assertTrue(b.toString().contains("Dependencies version conflicts (up to depth ∞):\n" + "  org.jboss.logging: 3.1.2.GA, 3.1.3.GA\n"));
}
Also used : CeylonInfoTool(com.redhat.ceylon.tools.info.CeylonInfoTool) Test(org.junit.Test)

Example 9 with CeylonInfoTool

use of com.redhat.ceylon.tools.info.CeylonInfoTool in project ceylon-compiler by ceylon.

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(com.redhat.ceylon.common.tool.OptionArgumentException) CeylonInfoTool(com.redhat.ceylon.tools.info.CeylonInfoTool) Test(org.junit.Test)

Example 10 with CeylonInfoTool

use of com.redhat.ceylon.tools.info.CeylonInfoTool in project ceylon-compiler by ceylon.

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(com.redhat.ceylon.tools.info.CeylonInfoTool) Test(org.junit.Test)

Aggregations

CeylonInfoTool (com.redhat.ceylon.tools.info.CeylonInfoTool)12 Test (org.junit.Test)12 OptionArgumentException (com.redhat.ceylon.common.tool.OptionArgumentException)1