use of com.redhat.ceylon.common.tool.OptionArgumentException in project ceylon-compiler by ceylon.
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(), options("--src=test/src", "com.redhat.ceylon.tools.test.nosuchmodule.ceylon"));
Assert.fail();
} catch (OptionArgumentException e) {
Assert.assertEquals("file not found: com.redhat.ceylon.tools.test.nosuchmodule.ceylon", e.getMessage());
}
}
use of com.redhat.ceylon.common.tool.OptionArgumentException 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.common.tool.OptionArgumentException 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());
}
}
use of com.redhat.ceylon.common.tool.OptionArgumentException in project ceylon-compiler by ceylon.
the class SrcToolTests method testNoArgs.
@Test
public void testNoArgs() throws Exception {
ToolModel<CeylonSrcTool> model = pluginLoader.loadToolModel("src");
Assert.assertNotNull(model);
try {
CeylonSrcTool 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 ImportJarToolTests method testJarOnly.
@Test
public void testJarOnly() {
ToolModel<CeylonImportJarTool> model = pluginLoader.loadToolModel("import-jar");
Assert.assertNotNull(model);
try {
CeylonImportJarTool tool = pluginFactory.bindArguments(model, getMainTool(), options("my.jar"));
Assert.fail();
} catch (OptionArgumentException e) {
Assert.assertEquals("Invalid value 'my.jar' given for argument 'module' to command 'import-jar'", e.getMessage());
}
}
Aggregations