Search in sources :

Example 1 with CeylonInfoTool

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

the class InfoToolTests method testModuleFromSource.

@Test
public void testModuleFromSource() throws Exception {
    ToolModel<CeylonInfoTool> model = pluginLoader.loadToolModel("info");
    Assert.assertNotNull(model);
    CeylonInfoTool tool = pluginFactory.bindArguments(model, getMainTool(), Arrays.<String>asList("--src", "test/src", "com.redhat.ceylon.tools.test.info/1"));
    StringBuilder b = new StringBuilder();
    tool.setOut(b);
    tool.run();
    Assert.assertTrue(b.toString().contains("Name:        com.redhat.ceylon.tools.test.info\n" + "Version:     1\n" + "Available:   On local system\n" + "Origin:      Local source folder\n" + "Dependency Tree (up to depth 1):\n" + "  shared java.base/7\n" + "  optional java.desktop/7\n"));
}
Also used : CeylonInfoTool(com.redhat.ceylon.tools.info.CeylonInfoTool) Test(org.junit.Test)

Example 2 with CeylonInfoTool

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

the class InfoToolTests method testJdkModule.

@Test
public void testJdkModule() throws Exception {
    ToolModel<CeylonInfoTool> model = pluginLoader.loadToolModel("info");
    Assert.assertNotNull(model);
    CeylonInfoTool tool = pluginFactory.bindArguments(model, getMainTool(), Collections.<String>singletonList("java.base/" + JDK.JDK7.version));
    StringBuilder b = new StringBuilder();
    tool.setOut(b);
    tool.run();
    Assert.assertTrue(b.toString().contains("Name:        java.base\n" + "Version:     7\n" + "Artifacts:   JVM (legacy)\n" + "Available:   On local system\n" + "Origin:      Java Runtime\n" + "Description: JDK module java.base\n"));
}
Also used : CeylonInfoTool(com.redhat.ceylon.tools.info.CeylonInfoTool) Test(org.junit.Test)

Example 3 with CeylonInfoTool

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

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("asm:asm-commons"));
    StringBuilder b = new StringBuilder();
    tool.setOut(b);
    tool.run();
    Assert.assertTrue(b.toString().contains("asm:asm-commons/2.0\n" + "asm:asm-commons/2.1\n" + "asm:asm-commons/2.2\n" + "asm:asm-commons/2.2.1\n" + "asm:asm-commons/3.0\n" + "asm:asm-commons/3.1\n" + "asm:asm-commons/3.2\n" + "asm:asm-commons/3.3\n" + "asm:asm-commons/3.3.1"));
}
Also used : CeylonInfoTool(com.redhat.ceylon.tools.info.CeylonInfoTool) Test(org.junit.Test)

Example 4 with CeylonInfoTool

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

the class InfoToolTests method testModuleVersion.

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

Example 5 with CeylonInfoTool

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

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(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