Search in sources :

Example 1 with JLineDevice

use of org.ow2.proactive_grid_cloud_portal.cli.console.JLineDevice in project scheduling by ow2-proactive.

the class AbstractSchedulerCommandTest method configureDevice.

protected void configureDevice() throws IOException {
    InputStream in = new ByteArrayInputStream(userInput.toString().getBytes());
    PrintStream out = new PrintStream(capturedOutput);
    AbstractDevice device = new JLineDevice(in, out);
    when(context.getDevice()).thenReturn(device);
    this.engine.getContext().setWriter(device.getWriter());
}
Also used : PrintStream(java.io.PrintStream) ByteArrayInputStream(java.io.ByteArrayInputStream) JLineDevice(org.ow2.proactive_grid_cloud_portal.cli.console.JLineDevice) ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) AbstractDevice(org.ow2.proactive_grid_cloud_portal.cli.console.AbstractDevice)

Example 2 with JLineDevice

use of org.ow2.proactive_grid_cloud_portal.cli.console.JLineDevice in project scheduling by ow2-proactive.

the class EntryPoint method getCommandFactory.

protected static CommandFactory getCommandFactory(ApplicationContext currentContext) throws IOException {
    CommandFactory commandFactory;
    AbstractDevice console;
    commandFactory = getCommandFactory();
    console = AbstractDevice.getConsole(AbstractDevice.JLINE);
    ((JLineDevice) console).setCommands(ObjectArrays.concat(commandFactory.supportedCommandEntries(), CommandSet.INTERACTIVE_COMMANDS, CommandSet.Entry.class));
    currentContext.setDevice(console);
    return commandFactory;
}
Also used : JLineDevice(org.ow2.proactive_grid_cloud_portal.cli.console.JLineDevice) AbstractDevice(org.ow2.proactive_grid_cloud_portal.cli.console.AbstractDevice)

Aggregations

AbstractDevice (org.ow2.proactive_grid_cloud_portal.cli.console.AbstractDevice)2 JLineDevice (org.ow2.proactive_grid_cloud_portal.cli.console.JLineDevice)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 InputStream (java.io.InputStream)1 PrintStream (java.io.PrintStream)1