Search in sources :

Example 6 with CeylonCompileJsTool

use of org.eclipse.ceylon.compiler.js.CeylonCompileJsTool in project ceylon by eclipse.

the class CompileJsToolTest method testDefaultInvalidSourceValidResource2.

@Test(expected = ToolUsageError.class)
public void testDefaultInvalidSourceValidResource2() throws Exception {
    FileUtil.delete(new File("build/test-modules"));
    ToolModel<CeylonCompileJsTool> tool = pluginLoader.loadToolModel("compile-js");
    Assert.assertNotNull(tool);
    CeylonCompileJsTool jsc = pluginFactory.bindArguments(tool, getMainTool(), args("--source=src/test/resources/invalid", "--resource=src/test/resources/res_test", "src/test/resources/doc/calls.ceylon", "src/test/resources/res_test/test.txt"));
    jsc.run();
}
Also used : CeylonCompileJsTool(org.eclipse.ceylon.compiler.js.CeylonCompileJsTool) File(java.io.File) Test(org.junit.Test)

Example 7 with CeylonCompileJsTool

use of org.eclipse.ceylon.compiler.js.CeylonCompileJsTool in project ceylon by eclipse.

the class CompileJsToolTest method testDefaultSourceValidResource.

@Test
public void testDefaultSourceValidResource() throws Exception {
    FileUtil.delete(new File("build/test-modules"));
    ToolModel<CeylonCompileJsTool> tool = pluginLoader.loadToolModel("compile-js");
    Assert.assertNotNull(tool);
    CeylonCompileJsTool jsc = pluginFactory.bindArguments(tool, getMainTool(), args("--source=src/test/resources/doc", "--resource=src/test/resources/res_test", "src/test/resources/doc/calls.ceylon", "src/test/resources/res_test/test.txt"));
    jsc.run();
    checkCompilerResult("build/test-modules/default", "default");
    checkResources("build/test-modules/default", "default", "test.txt");
    checkExcludedResources("build/test-modules/default", "default", "m1res.txt", "m1/m1res.txt", "subdir/third.txt", "ROOT/inroot.txt", "ALTROOT/altroot.txt");
}
Also used : CeylonCompileJsTool(org.eclipse.ceylon.compiler.js.CeylonCompileJsTool) File(java.io.File) Test(org.junit.Test)

Example 8 with CeylonCompileJsTool

use of org.eclipse.ceylon.compiler.js.CeylonCompileJsTool in project ceylon by eclipse.

the class CompileJsToolTest method testModule.

@Test
public void testModule() throws Exception {
    FileUtil.delete(new File("build/test-modules"));
    ToolModel<CeylonCompileJsTool> tool = pluginLoader.loadToolModel("compile-js");
    Assert.assertNotNull(tool);
    CeylonCompileJsTool jsc = pluginFactory.bindArguments(tool, getMainTool(), args("--source=src/test/resources/loader/pass1", "--resource=src/test/resources/res_test", "m1"));
    jsc.run();
    checkCompilerResult("build/test-modules/m1/0.1", "m1-0.1");
    checkResources("build/test-modules/m1/0.1", "m1-0.1", "m1root.txt", "m1/m1res.txt", "m1/ALTROOT/altrootm1.txt");
    checkExcludedResources("build/test-modules/m1/0.1", "m1-0.1", "test.txt", "another_test.txt", "subdir/third.txt", "ROOT/inroot.txt", "ALTROOT/altroot.txt");
}
Also used : CeylonCompileJsTool(org.eclipse.ceylon.compiler.js.CeylonCompileJsTool) File(java.io.File) Test(org.junit.Test)

Example 9 with CeylonCompileJsTool

use of org.eclipse.ceylon.compiler.js.CeylonCompileJsTool in project ceylon by eclipse.

the class CompileJsToolTest method testDefaultSourceInvalidResource2.

@Test(expected = ToolUsageError.class)
public void testDefaultSourceInvalidResource2() throws Exception {
    FileUtil.delete(new File("build/test-modules"));
    ToolModel<CeylonCompileJsTool> tool = pluginLoader.loadToolModel("compile-js");
    Assert.assertNotNull(tool);
    CeylonCompileJsTool jsc = pluginFactory.bindArguments(tool, getMainTool(), args("--source=src/test/resources/doc", "--resource=src/test/resources/invalid", "src/test/resources/doc/calls.ceylon", "src/test/resources/res_test/test.txt"));
    jsc.run();
}
Also used : CeylonCompileJsTool(org.eclipse.ceylon.compiler.js.CeylonCompileJsTool) File(java.io.File) Test(org.junit.Test)

Example 10 with CeylonCompileJsTool

use of org.eclipse.ceylon.compiler.js.CeylonCompileJsTool in project ceylon by eclipse.

the class CompileJsToolTest method testModuleSourceValidResource.

@Test
public void testModuleSourceValidResource() throws Exception {
    FileUtil.delete(new File("build/test-modules"));
    ToolModel<CeylonCompileJsTool> tool = pluginLoader.loadToolModel("compile-js");
    Assert.assertNotNull(tool);
    CeylonCompileJsTool jsc = pluginFactory.bindArguments(tool, getMainTool(), args("--source=src/test/resources/loader/pass1", "--resource=src/test/resources/res_test", "src/test/resources/loader/pass1/m1/test.ceylon", "src/test/resources/loader/pass1/m1/module.ceylon", "src/test/resources/loader/pass1/m1/package.ceylon", "src/test/resources/res_test/m1/m1res.txt"));
    jsc.run();
    checkCompilerResult("build/test-modules/m1/0.1", "m1-0.1");
    checkResources("build/test-modules/m1/0.1", "m1-0.1", "m1/m1res.txt");
    checkExcludedResources("build/test-modules/m1/0.1", "m1-0.1", "test.txt", "another_test.txt", "subdir/third.txt", "m1root.txt", "ROOT/m1root.txt", "ROOT/inroot.txt", "ALTROOT/altroot.txt");
}
Also used : CeylonCompileJsTool(org.eclipse.ceylon.compiler.js.CeylonCompileJsTool) File(java.io.File) Test(org.junit.Test)

Aggregations

File (java.io.File)19 CeylonCompileJsTool (org.eclipse.ceylon.compiler.js.CeylonCompileJsTool)19 Test (org.junit.Test)18 ArrayList (java.util.ArrayList)1 CeylonRunJsTool (org.eclipse.ceylon.compiler.js.CeylonRunJsTool)1 CompilerErrorException (org.eclipse.ceylon.compiler.js.CompilerErrorException)1 DiagnosticListener (org.eclipse.ceylon.compiler.js.DiagnosticListener)1