use of com.redhat.ceylon.compiler.CeylonCompileTool in project ceylon-compiler by ceylon.
the class CompilerToolTests method testCompileDefault.
@Test
public void testCompileDefault() throws Exception {
ToolModel<CeylonCompileTool> model = pluginLoader.loadToolModel("compile");
Assert.assertNotNull(model);
CeylonCompileTool tool = pluginFactory.bindArguments(model, getMainTool(), options("--src=test/src/com/redhat/ceylon/tools/test/deflt", "default"));
tool.run();
}
use of com.redhat.ceylon.compiler.CeylonCompileTool in project ceylon-compiler by ceylon.
the class CompilerToolTests method testBug1179.
@Test
public void testBug1179() throws Exception {
ToolModel<CeylonCompileTool> model = pluginLoader.loadToolModel("compile");
Assert.assertNotNull(model);
try {
CeylonCompileTool tool = pluginFactory.bindArguments(model, getMainTool(), options("--src=test/src", "3"));
Assert.fail("Tool should have thrown an exception");
} catch (OptionArgumentException x) {
Assert.assertEquals("Invalid module name or source file: 3\n" + "Module names should not contain any version part.\n" + "Source file names should be given relative to the current directory.", x.getMessage());
}
}
use of com.redhat.ceylon.compiler.CeylonCompileTool in project ceylon-compiler by ceylon.
the class CompilerToolTests method testCompileValidEncoding.
@Test
public void testCompileValidEncoding() throws Exception {
ToolModel<CeylonCompileTool> model = pluginLoader.loadToolModel("compile");
Assert.assertNotNull(model);
CeylonCompileTool tool = pluginFactory.bindArguments(model, getMainTool(), options("--src=test/src", "--encoding=UTF-8", "com.redhat.ceylon.tools.test.ceylon"));
}
use of com.redhat.ceylon.compiler.CeylonCompileTool in project ceylon-compiler by ceylon.
the class CompilerToolTests method testCompileWithSyntaxErrors.
@Test
public void testCompileWithSyntaxErrors() throws Exception {
ToolModel<CeylonCompileTool> model = pluginLoader.loadToolModel("compile");
Assert.assertNotNull(model);
CeylonCompileTool tool = pluginFactory.bindArguments(model, getMainTool(), options("--src=test/src", "com.redhat.ceylon.tools.test.syntax"));
try {
tool.run();
Assert.fail("Tool should have thrown an exception");
} catch (CompilerErrorException x) {
Assert.assertEquals("There was 1 error", x.getMessage());
} catch (Throwable t) {
t.printStackTrace();
Assert.fail("Unexpected exception");
}
}
use of com.redhat.ceylon.compiler.CeylonCompileTool in project ceylon-compiler by ceylon.
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(), options("--src=test/src", "com.redhat.ceylon.tools.test.nosuchmodule.java"));
Assert.fail();
} catch (OptionArgumentException e) {
Assert.assertEquals("file not found: com.redhat.ceylon.tools.test.nosuchmodule.java", e.getMessage());
}
}
Aggregations