Search in sources :

Example 1 with CeylonSrcTool

use of org.eclipse.ceylon.tools.src.CeylonSrcTool in project ceylon by eclipse.

the class SrcToolTests method testModuleOnly.

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

Example 2 with CeylonSrcTool

use of org.eclipse.ceylon.tools.src.CeylonSrcTool in project ceylon by eclipse.

the class SrcToolTests method testOffline.

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

Example 3 with CeylonSrcTool

use of org.eclipse.ceylon.tools.src.CeylonSrcTool in project ceylon by eclipse.

the class SrcToolTests method testNoArgs.

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

Example 4 with CeylonSrcTool

use of org.eclipse.ceylon.tools.src.CeylonSrcTool in project ceylon by eclipse.

the class SrcToolTests method testModuleVersion.

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

Example 5 with CeylonSrcTool

use of org.eclipse.ceylon.tools.src.CeylonSrcTool in project ceylon by eclipse.

the class SrcToolTests method testUnpacking.

@Test
public void testUnpacking() throws Exception {
    compile("src_tool_test/module.ceylon", "src_tool_test/package.ceylon", "src_tool_test/foo.ceylon");
    ToolModel<CeylonSrcTool> model = pluginLoader.loadToolModel("src");
    Assert.assertNotNull(model);
    CeylonSrcTool tool = pluginFactory.bindArguments(model, getMainTool(), Arrays.<String>asList("--cacherep", getCachePath(), "--rep", getOutPath(), "--src", "build/test-source", "org.eclipse.ceylon.tools.test.test_mod_source.src_tool_test/1.0.0"));
    tool.run();
    String path = "build/test-source/org/eclipse/ceylon/tools/test/test_mod_source/src_tool_test";
    File dir = new File(path);
    Assert.assertTrue(dir.isDirectory());
    File moduleFile = new File(dir, "module.ceylon");
    Assert.assertTrue(moduleFile.isFile());
    File packageFile = new File(dir, "package.ceylon");
    Assert.assertTrue(packageFile.isFile());
    File fooFile = new File(dir, "foo.ceylon");
    Assert.assertTrue(fooFile.isFile());
}
Also used : CeylonSrcTool(org.eclipse.ceylon.tools.src.CeylonSrcTool) File(java.io.File) Test(org.junit.Test)

Aggregations

CeylonSrcTool (org.eclipse.ceylon.tools.src.CeylonSrcTool)6 Test (org.junit.Test)6 File (java.io.File)2 OptionArgumentException (org.eclipse.ceylon.common.tool.OptionArgumentException)1