use of org.eclipse.ceylon.common.tool.OptionArgumentException in project ceylon by eclipse.
the class CompilerToolTests method testCompileNoSuchEncoding.
@Test
public void testCompileNoSuchEncoding() throws Exception {
ToolModel<CeylonCompileTool> model = pluginLoader.loadToolModel("compile");
Assert.assertNotNull(model);
try {
CeylonCompileTool tool = pluginFactory.bindArguments(model, getMainTool(), toolOptions("--src=test/src", "--encoding=foo", "org.eclipse.ceylon.tools.test.ceylon"));
Assert.fail();
} catch (OptionArgumentException e) {
Assert.assertEquals("Unsupported encoding: foo", e.getMessage());
}
}
use of org.eclipse.ceylon.common.tool.OptionArgumentException 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.common.tool.OptionArgumentException 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.common.tool.OptionArgumentException in project ceylon by eclipse.
the class RunToolTestCase method testNoArgs.
@Test
public void testNoArgs() throws Exception {
ToolModel<CeylonRunTool> model = pluginLoader.loadToolModel("run");
Assert.assertNotNull(model);
try {
CeylonRunTool tool = pluginFactory.bindArguments(model, getMainTool(), Collections.<String>emptyList());
Assert.fail();
} catch (OptionArgumentException e) {
// asserting this is thrown
}
}
Aggregations