use of com.redhat.ceylon.common.tools.help.CeylonHelpTool in project ceylon-compiler by ceylon.
the class TopLevelToolTests method getHelpOutput.
private String getHelpOutput(String toolName) {
StringWriter sw = new StringWriter();
CeylonHelpTool helpTool = new CeylonHelpTool();
helpTool.setToolLoader(toolLoader);
if (toolName != null && !toolName.isEmpty()) {
helpTool.setTool(toolLoader.loadToolModel(toolName));
}
helpTool.setOut(sw);
helpTool.run();
return sw.toString();
}
use of com.redhat.ceylon.common.tools.help.CeylonHelpTool in project ceylon-compiler by ceylon.
the class HelpToolTests method testHelpDocTool.
@Test
public void testHelpDocTool() {
ToolModel<CeylonHelpTool> model = pluginLoader.loadToolModel("help");
Assert.assertNotNull(model);
CeylonHelpTool tool = pluginFactory.bindArguments(model, getMainTool(), Arrays.asList("doc-tool"));
tool.run();
}
use of com.redhat.ceylon.common.tools.help.CeylonHelpTool in project ceylon-compiler by ceylon.
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 com.redhat.ceylon.common.tools.help.CeylonHelpTool in project ceylon-compiler by ceylon.
the class HelpToolTests method testHelp.
@Test
public void testHelp() {
ToolModel<CeylonHelpTool> model = pluginLoader.loadToolModel("help");
Assert.assertNotNull(model);
Assert.assertTrue(model.isPorcelain());
CeylonHelpTool tool = pluginFactory.bindArguments(model, getMainTool(), Collections.<String>emptyList());
tool.run();
}
use of com.redhat.ceylon.common.tools.help.CeylonHelpTool in project ceylon-compiler by ceylon.
the class HelpToolTests method testHelpImportJar.
@Test
public void testHelpImportJar() {
ToolModel<CeylonHelpTool> model = pluginLoader.loadToolModel("help");
Assert.assertNotNull(model);
CeylonHelpTool tool = pluginFactory.bindArguments(model, getMainTool(), Arrays.asList("import-jar"));
tool.run();
}
Aggregations