use of com.redhat.ceylon.common.tool.OptionArgumentException in project ceylon-compiler by ceylon.
the class ImportJarToolTests method testModuleOnlyJar.
@Test
public void testModuleOnlyJar() {
ToolModel<CeylonImportJarTool> model = pluginLoader.loadToolModel("import-jar");
Assert.assertNotNull(model);
try {
CeylonImportJarTool tool = pluginFactory.bindArguments(model, getMainTool(), options("test", "my.jar"));
Assert.fail();
} catch (OptionArgumentException e) {
Assert.assertEquals("Invalid value 'test' given for argument 'module' to command 'import-jar'", e.getMessage());
}
}
use of com.redhat.ceylon.common.tool.OptionArgumentException in project ceylon-compiler by ceylon.
the class ImportJarToolTests method testNoArgs.
@Test
public void testNoArgs() {
ToolModel<CeylonImportJarTool> model = pluginLoader.loadToolModel("import-jar");
Assert.assertNotNull(model);
try {
CeylonImportJarTool tool = pluginFactory.bindArguments(model, getMainTool(), options());
Assert.fail();
} catch (OptionArgumentException e) {
Assert.assertEquals("Argument 'module' to command 'import-jar' should appear at least 1 time(s)", e.getMessage());
}
}
use of com.redhat.ceylon.common.tool.OptionArgumentException in project ceylon-compiler by ceylon.
the class CompilerToolTests method testCompileNoSuchModule.
@Test
public void testCompileNoSuchModule() 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"));
Assert.fail();
} catch (OptionArgumentException e) {
Assert.assertEquals("Module com.redhat.ceylon.tools.test.nosuchmodule not found in source directories: test" + File.separator + "src", e.getMessage());
}
}
use of com.redhat.ceylon.common.tool.OptionArgumentException in project ceylon-compiler by ceylon.
the class InfoToolTests method testNoArgs.
@Test
public void testNoArgs() throws Exception {
ToolModel<CeylonInfoTool> model = pluginLoader.loadToolModel("info");
Assert.assertNotNull(model);
try {
CeylonInfoTool tool = pluginFactory.bindArguments(model, getMainTool(), Collections.<String>emptyList());
Assert.fail();
} catch (OptionArgumentException e) {
// asserting this is thrown
}
}
use of com.redhat.ceylon.common.tool.OptionArgumentException in project ceylon-compiler by ceylon.
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(), options("--src=test/src", "--encoding=foo", "com.redhat.ceylon.tools.test.ceylon"));
Assert.fail();
} catch (OptionArgumentException e) {
Assert.assertEquals("Unsupported encoding: foo", e.getMessage());
}
}
Aggregations