use of org.eclipse.ceylon.compiler.CeylonCompileTool in project ceylon by eclipse.
the class CompilerToolTests method testCompileMultipleAutodetect.
@Test
public void testCompileMultipleAutodetect() throws Exception {
File carFile1 = getModuleArchive("com.first", "1");
carFile1.delete();
File carFile2 = getModuleArchive("com.second", "1");
carFile2.delete();
File carFile3 = getModuleArchive("single", "1");
carFile3.delete();
ToolModel<CeylonCompileTool> model = pluginLoader.loadToolModel("compile");
Assert.assertNotNull(model);
CeylonCompileTool tool = pluginFactory.bindArguments(model, getMainTool(), toolOptions("--src=test/src/org/eclipse/ceylon/tools/test/bugCC59"));
tool.run();
assertTrue(carFile1.exists() && carFile2.exists() && carFile3.exists());
}
use of org.eclipse.ceylon.compiler.CeylonCompileTool in project ceylon by eclipse.
the class CompilerToolTests method testCompileModuleAndVersion.
@Test
public void testCompileModuleAndVersion() throws Exception {
ToolModel<CeylonCompileTool> model = pluginLoader.loadToolModel("compile");
Assert.assertNotNull(model);
try {
CeylonCompileTool tool = pluginFactory.bindArguments(model, getMainTool(), toolOptions("--src=test/src", "org.eclipse.ceylon.tools.test.ceylon/1.0"));
Assert.fail();
} catch (OptionArgumentException e) {
Assert.assertEquals("Invalid module name or source file: org.eclipse.ceylon.tools.test.ceylon/1.0\n" + "Module names should not contain any version part.\n" + "Source file names should be given relative to the current directory.", e.getMessage());
}
}
use of org.eclipse.ceylon.compiler.CeylonCompileTool in project ceylon by eclipse.
the class CompilerToolTests method testCompileNoSuchModuleDotJava.
@Test
public void testCompileNoSuchModuleDotJava() throws Exception {
ToolModel<CeylonCompileTool> model = pluginLoader.loadToolModel("compile");
Assert.assertNotNull(model);
try {
CeylonCompileTool tool = pluginFactory.bindArguments(model, getMainTool(), toolOptions("--src=test/src", "org.eclipse.ceylon.tools.test.nosuchmodule.java"));
Assert.fail();
} catch (OptionArgumentException e) {
Assert.assertEquals("file not found: org.eclipse.ceylon.tools.test.nosuchmodule.java", e.getMessage());
}
}
use of org.eclipse.ceylon.compiler.CeylonCompileTool in project ceylon by eclipse.
the class CompilerToolTests method testBadIntegerLiteral.
@Test
public void testBadIntegerLiteral() throws Exception {
ToolModel<CeylonCompileTool> model = pluginLoader.loadToolModel("compile");
Assert.assertNotNull(model);
CeylonCompileTool tool = pluginFactory.bindArguments(model, getMainTool(), toolOptions("--src=test/src", "org.eclipse.ceylon.tools.test.badintegerliteral"));
try {
tool.run();
Assert.fail("Tool should have thrown an exception");
} catch (CompilerErrorException e) {
// We expect this, not a FatalToolError
}
}
Aggregations