use of org.eclipse.ceylon.common.tool.OptionArgumentException in project ceylon by eclipse.
the class HelpToolTests method testHelpCompiler.
@Test
public void testHelpCompiler() {
ToolModel<CeylonHelpTool> model = pluginLoader.loadToolModel("help");
Assert.assertNotNull(model);
CeylonHelpTool tool = pluginFactory.bindArguments(model, getMainTool(), Arrays.asList("compile"));
tool.setToolLoader(pluginLoader);
tool.run();
try {
pluginFactory.bindArguments(model, getMainTool(), Arrays.asList("--", "compile", "--javac="));
Assert.fail();
} catch (OptionArgumentException e) {
Assert.assertEquals("Unexpected argument '--javac=' to command 'help'", e.getMessage());
}
}
use of org.eclipse.ceylon.common.tool.OptionArgumentException in project ceylon by eclipse.
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(), toolOptions("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 org.eclipse.ceylon.common.tool.OptionArgumentException in project ceylon by eclipse.
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 org.eclipse.ceylon.common.tool.OptionArgumentException in project ceylon by eclipse.
the class MavenExportToolTests method testNoArgs.
@Test
public void testNoArgs() {
ToolModel<CeylonMavenExportTool> model = pluginLoader.loadToolModel("maven-export");
Assert.assertNotNull(model);
try {
CeylonMavenExportTool tool = pluginFactory.bindArguments(model, getMainTool(), toolOptions());
Assert.fail();
} catch (OptionArgumentException e) {
Assert.assertEquals("Argument 'module' to command 'maven-export' should appear at least 1 time(s)", e.getMessage());
}
}
use of org.eclipse.ceylon.common.tool.OptionArgumentException in project ceylon by eclipse.
the class CompilerToolTests method testCompileNoSuchModuleDotCeylon.
@Test
public void testCompileNoSuchModuleDotCeylon() 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.ceylon"));
Assert.fail();
} catch (OptionArgumentException e) {
Assert.assertEquals("file not found: org.eclipse.ceylon.tools.test.nosuchmodule.ceylon", e.getMessage());
}
}
Aggregations