Package org.impalaframework.interactive.command

Examples of org.impalaframework.interactive.command.InteractiveTestCommand


    GlobalCommandState.getInstance().addValue(CommandStateConstants.TEST_CLASS, testClass);

    Command initCommand = getInitCommand();
    initCommand.execute(commandState);

    InteractiveTestCommand testCommand = new InteractiveTestCommand();
    StopCheckerListener stopCheckerListener = new StopCheckerListener();

    Integer maxInactiveSeconds = getMaxInactiveSeconds();

    if (maxInactiveSeconds != null) {
      stopCheckerListener.setMaxInactiveSeconds(maxInactiveSeconds);
      stopCheckerListener.start();
      testCommand.addTestListener(stopCheckerListener);
    }

    Map<String, String> aliasMap = getAliasMap();
    testCommand.setAliasMap(aliasMap);
    Map<String, Command> commandMap = getCommandMap();
    commandMap.put("usage", new UsageCommand(commandMap, aliasMap));
    testCommand.setCommandMap(commandMap);

    System.out.println("--------------------");

    while (true) {
      commandState.capture(testCommand);

      try {
        testCommand.execute(commandState);
      }
      catch (TerminatedApplicationException e) {
        break;
      }
    }
View Full Code Here


        GlobalCommandState.getInstance().addValue(CommandStateConstants.TEST_CLASS, testClass);

        Command initCommand = getInitCommand();
        initCommand.execute(commandState);

        InteractiveTestCommand testCommand = new InteractiveTestCommand();
        StopCheckerListener stopCheckerListener = new StopCheckerListener();

        Integer maxInactiveSeconds = getMaxInactiveSeconds();

        if (maxInactiveSeconds != null) {
            stopCheckerListener.setMaxInactiveSeconds(maxInactiveSeconds);
            stopCheckerListener.start();
            testCommand.addTestListener(stopCheckerListener);
        }

        Map<String, String> aliasMap = getAliasMap();
        testCommand.setAliasMap(aliasMap);
        Map<String, Command> commandMap = getCommandMap();
        commandMap.put("usage", new UsageCommand(commandMap, aliasMap));
        testCommand.setCommandMap(commandMap);

        System.out.println("--------------------");

        while (true) {
            commandState.capture(testCommand);

            try {
                testCommand.execute(commandState);
            }
            catch (TerminatedApplicationException e) {
                break;
            }
        }
View Full Code Here

        GlobalCommandState.getInstance().addValue(CommandStateConstants.TEST_CLASS, testClass);

        Command initCommand = getInitCommand();
        initCommand.execute(commandState);

        InteractiveTestCommand testCommand = new InteractiveTestCommand();
        StopCheckerListener stopCheckerListener = new StopCheckerListener();

        Integer maxInactiveSeconds = getMaxInactiveSeconds();

        if (maxInactiveSeconds != null) {
            stopCheckerListener.setMaxInactiveSeconds(maxInactiveSeconds);
            stopCheckerListener.start();
            testCommand.addTestListener(stopCheckerListener);
        }

        Map<String, String> aliasMap = getAliasMap();
        testCommand.setAliasMap(aliasMap);
        Map<String, Command> commandMap = getCommandMap();
        commandMap.put("usage", new UsageCommand(commandMap, aliasMap));
        testCommand.setCommandMap(commandMap);

        System.out.println("--------------------");

        while (true) {
            commandState.capture(testCommand);

            try {
                testCommand.execute(commandState);
            }
            catch (TerminatedApplicationException e) {
                break;
            }
        }
View Full Code Here

        GlobalCommandState.getInstance().addValue(CommandStateConstants.TEST_CLASS, testClass);

        Command initCommand = getInitCommand();
        initCommand.execute(commandState);

        InteractiveTestCommand testCommand = new InteractiveTestCommand();
        StopCheckerListener stopCheckerListener = new StopCheckerListener();

        Integer maxInactiveSeconds = getMaxInactiveSeconds();

        if (maxInactiveSeconds != null) {
            stopCheckerListener.setMaxInactiveSeconds(maxInactiveSeconds);
            stopCheckerListener.start();
            testCommand.addTestListener(stopCheckerListener);
        }

        Map<String, String> aliasMap = getAliasMap();
        testCommand.setAliasMap(aliasMap);
        Map<String, Command> commandMap = getCommandMap();
        commandMap.put("usage", new UsageCommand(commandMap, aliasMap));
        testCommand.setCommandMap(commandMap);

        System.out.println("--------------------");

        while (true) {
            commandState.capture(testCommand);

            try {
                testCommand.execute(commandState);
            }
            catch (TerminatedApplicationException e) {
                break;
            }
        }
View Full Code Here

        GlobalCommandState.getInstance().addValue(CommandStateConstants.TEST_CLASS, testClass);

        Command initCommand = getInitCommand();
        initCommand.execute(commandState);

        InteractiveTestCommand testCommand = new InteractiveTestCommand();
        StopCheckerListener stopCheckerListener = new StopCheckerListener();

        Integer maxInactiveSeconds = getMaxInactiveSeconds();

        if (maxInactiveSeconds != null) {
            stopCheckerListener.setMaxInactiveSeconds(maxInactiveSeconds);
            stopCheckerListener.start();
            testCommand.addTestListener(stopCheckerListener);
        }

        Map<String, String> aliasMap = getAliasMap();
        testCommand.setAliasMap(aliasMap);
        Map<String, Command> commandMap = getCommandMap();
        commandMap.put("usage", new UsageCommand(commandMap, aliasMap));
        testCommand.setCommandMap(commandMap);

        System.out.println("--------------------");

        while (true) {
            commandState.capture(testCommand);

            try {
                testCommand.execute(commandState);
            }
            catch (TerminatedApplicationException e) {
                break;
            }
        }
View Full Code Here

public class ManualInteractiveTestCommandTest extends TestCase {

    public void testInteractive() throws Exception {

        InteractiveTestCommand command = getCommand();
        Map<String, Command> commandMap = getCommandMap();
        Set<String> commandKeys = commandMap.keySet();
       
        for (String commandKey : commandKeys) {
            command.addCommand(commandKey, commandMap.get(commandKey));
        }

        // now need to capture
        CommandState commandState = new CommandState();

        CommandLineInputCapturer inputCapturer = getInputCapturer();
        commandState.setInputCapturer(inputCapturer);

        System.out.println("--------------------");

        commandState.capture(command);
        command.execute(commandState);
    }
View Full Code Here

        commands.put("reload-all", new ReloadCommand());
        return commands;
    }

    protected InteractiveTestCommand getCommand() {
        InteractiveTestCommand command = new InteractiveTestCommand();
        return command;
    }
View Full Code Here

TOP

Related Classes of org.impalaframework.interactive.command.InteractiveTestCommand

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.