Search in sources :

Example 1 with CeylonRunJsTool

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

the class RunJsTest method testModuleLoading.

@Test
public void testModuleLoading() throws Exception {
    CeylonRunJsTool runner = new CeylonRunJsTool();
    runner.setModuleVersion("misc/0.1");
    runner.setRun("test");
    runner.setRepository(Arrays.asList(new URI(tmpModules.getAbsolutePath()), new URI("build/runtime"), new URI("build/test/proto")));
    runner.run();
}
Also used : CeylonRunJsTool(org.eclipse.ceylon.compiler.js.CeylonRunJsTool) URI(java.net.URI) Test(org.junit.Test)

Example 2 with CeylonRunJsTool

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

the class RunJsTest method testResources.

@Test
public void testResources() throws Exception {
    // Compile a module with resources
    CeylonCompileJsTool compiler = new CeylonCompileJsTool();
    compiler.setRepositoryAsStrings(Arrays.asList("build/runtime"));
    compiler.setSource(Arrays.asList(new File("src/test/resources/doc")));
    compiler.setSkipSrcArchive(true);
    compiler.setResource(Arrays.asList(new File("src/test/resources/res_test")));
    compiler.setModule(Arrays.asList("default"));
    compiler.setOut("build/modules");
    compiler.run();
    // Run it, just to make sure the resources were exploded
    CeylonRunJsTool runner = new CeylonRunJsTool();
    runner.setModuleVersion("default");
    runner.setRun("run");
    runner.setRepositoryAsStrings(Arrays.asList("build/runtime", "build/modules"));
    runner.run();
    Assert.assertTrue("test.txt is missing", new File("build/modules/default/module-resources/test.txt").exists());
    Assert.assertTrue("another_test.txt is missing", new File("build/modules/default/module-resources/another_test.txt").exists());
    Assert.assertTrue("third.txt is missing", new File("build/modules/default/module-resources/subdir/third.txt").exists());
}
Also used : CeylonRunJsTool(org.eclipse.ceylon.compiler.js.CeylonRunJsTool) CeylonCompileJsTool(org.eclipse.ceylon.compiler.js.CeylonCompileJsTool) File(java.io.File) Test(org.junit.Test)

Aggregations

CeylonRunJsTool (org.eclipse.ceylon.compiler.js.CeylonRunJsTool)2 Test (org.junit.Test)2 File (java.io.File)1 URI (java.net.URI)1 CeylonCompileJsTool (org.eclipse.ceylon.compiler.js.CeylonCompileJsTool)1