Search in sources :

Example 6 with CeylonRunTool

use of ceylon.modules.bootstrap.CeylonRunTool in project ceylon by eclipse.

the class RunToolTestCase method testDefaultArg.

@Test
public void testDefaultArg() throws Exception {
    ToolModel<CeylonRunTool> model = pluginLoader.loadToolModel("run");
    Assert.assertNotNull(model);
    CeylonRunTool tool = pluginFactory.bindArguments(model, getMainTool(), options("default", "Tako"));
    assertOutput(tool, OUT_EXPECTED_WITH_ARG);
}
Also used : CeylonRunTool(ceylon.modules.bootstrap.CeylonRunTool) Test(org.junit.Test) AbstractToolTest(org.eclipse.ceylon.common.tool.AbstractToolTest)

Example 7 with CeylonRunTool

use of ceylon.modules.bootstrap.CeylonRunTool in project ceylon by eclipse.

the class RunToolTestCase method testModuleVersionArgs.

@Test
public void testModuleVersionArgs() throws Exception {
    ToolModel<CeylonRunTool> model = pluginLoader.loadToolModel("run");
    Assert.assertNotNull(model);
    CeylonRunTool tool = pluginFactory.bindArguments(model, getMainTool(), options("hello/1.0.0", "Tako"));
    assertOutput(tool, OUT_EXPECTED_WITH_ARG);
}
Also used : CeylonRunTool(ceylon.modules.bootstrap.CeylonRunTool) Test(org.junit.Test) AbstractToolTest(org.eclipse.ceylon.common.tool.AbstractToolTest)

Example 8 with CeylonRunTool

use of ceylon.modules.bootstrap.CeylonRunTool in project ceylon by eclipse.

the class RunToolTestCase method testModuleVersionFunction.

@Test
public void testModuleVersionFunction() throws Exception {
    ToolModel<CeylonRunTool> model = pluginLoader.loadToolModel("run");
    Assert.assertNotNull(model);
    CeylonRunTool tool = pluginFactory.bindArguments(model, getMainTool(), options("--run=hello.hello", "hello/1.0.0"));
    assertOutput(tool, OUT_EXPECTED_DEFAULT);
}
Also used : CeylonRunTool(ceylon.modules.bootstrap.CeylonRunTool) Test(org.junit.Test) AbstractToolTest(org.eclipse.ceylon.common.tool.AbstractToolTest)

Example 9 with CeylonRunTool

use of ceylon.modules.bootstrap.CeylonRunTool in project ceylon by eclipse.

the class RunToolTestCase method testDefault.

@Test
public void testDefault() throws Exception {
    ToolModel<CeylonRunTool> model = pluginLoader.loadToolModel("run");
    Assert.assertNotNull(model);
    CeylonRunTool tool = pluginFactory.bindArguments(model, getMainTool(), options("default"));
    assertOutput(tool, OUT_EXPECTED_DEFAULT);
}
Also used : CeylonRunTool(ceylon.modules.bootstrap.CeylonRunTool) Test(org.junit.Test) AbstractToolTest(org.eclipse.ceylon.common.tool.AbstractToolTest)

Example 10 with CeylonRunTool

use of ceylon.modules.bootstrap.CeylonRunTool in project ceylon by eclipse.

the class RunToolTestCase method testCompileForce.

@Test
public void testCompileForce() throws Exception {
    ToolModel<CeylonRunTool> model = pluginLoader.loadToolModel("run");
    Assert.assertNotNull(model);
    CeylonRunTool tool = pluginFactory.bindArguments(model, getMainTool(), options("--offline", "--rep", "build/test/modules", "--compile=force", "--compiler-arguments=--sysrep", "--compiler-arguments=../dist/dist/repo", "--compiler-arguments=--offline", "--compiler-arguments=--source", "--compiler-arguments=testsuite/src/test/resources/source", "--compiler-arguments=--out", "--compiler-arguments=build/test/modules", "bug7035/1"));
    tool.run();
    // run it again, should force
    tool = pluginFactory.bindArguments(model, getMainTool(), options("--offline", "--rep", "build/test/modules", "--compile=force", "--compiler-arguments=--sysrep", "--compiler-arguments=../dist/dist/repo", "--compiler-arguments=--offline", "--compiler-arguments=--source", "--compiler-arguments=testsuite/src/test/resources/source", "--compiler-arguments=--out", "--compiler-arguments=build/test/modules", "bug7035/1"));
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    PrintStream out = new PrintStream(baos);
    tool.setOut(out);
    tool.run();
    assertTrue(baos.size() > 0);
    assertTrue(baos.toString().contains("Source found for module bug7035, compiling..."));
}
Also used : CeylonRunTool(ceylon.modules.bootstrap.CeylonRunTool) PrintStream(java.io.PrintStream) ByteArrayOutputStream(java.io.ByteArrayOutputStream) Test(org.junit.Test) AbstractToolTest(org.eclipse.ceylon.common.tool.AbstractToolTest)

Aggregations

CeylonRunTool (ceylon.modules.bootstrap.CeylonRunTool)14 AbstractToolTest (org.eclipse.ceylon.common.tool.AbstractToolTest)14 Test (org.junit.Test)14 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 PrintStream (java.io.PrintStream)1 OptionArgumentException (org.eclipse.ceylon.common.tool.OptionArgumentException)1