Package org.impalaframework.command.framework

Examples of org.impalaframework.command.framework.CommandState


    if (facadeClassName == null) {
      //set the InteractiveOperationsFacade to apply by default
      System.setProperty(FacadeConstants.FACADE_CLASS_NAME, InteractiveOperationsFacade.class.getName());
    }

    CommandState commandState = new CommandState();
    CommandLineInputCapturer inputCapturer = new CommandLineInputCapturer();
    commandState.setInputCapturer(inputCapturer);

    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) {
View Full Code Here


        if (facadeClassName == null) {
            //set the InteractiveOperationsFacade to apply by default
            System.setProperty(FacadeConstants.FACADE_CLASS_NAME, InteractiveWebOperationsFacade.class.getName());
        }

        CommandState commandState = new CommandState();
        CommandLineInputCapturer inputCapturer = new CommandLineInputCapturer();
        commandState.setInputCapturer(inputCapturer);

        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) {
View Full Code Here

    if (facadeClassName == null) {
      //set the InteractiveOperationsFacade to apply by default
      System.setProperty(FacadeConstants.FACADE_CLASS_NAME, InteractiveOperationsFacade.class.getName());
    }

    CommandState commandState = new CommandState();
    CommandLineInputCapturer inputCapturer = new CommandLineInputCapturer();
    commandState.setInputCapturer(inputCapturer);

    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) {
View Full Code Here

        if (facadeClassName == null) {
            //set the InteractiveOperationsFacade to apply by default
            System.setProperty(FacadeConstants.FACADE_CLASS_NAME, InteractiveOperationsFacade.class.getName());
        }

        CommandState commandState = new CommandState();
        CommandLineInputCapturer inputCapturer = new CommandLineInputCapturer();
        commandState.setInputCapturer(inputCapturer);

        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) {
View Full Code Here

        if (facadeClassName == null) {
            //set the InteractiveOperationsFacade to apply by default
            System.setProperty(FacadeConstants.FACADE_CLASS_NAME, InteractiveOperationsFacade.class.getName());
        }

        CommandState commandState = new CommandState();
        CommandLineInputCapturer inputCapturer = new CommandLineInputCapturer();
        commandState.setInputCapturer(inputCapturer);

        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) {
View Full Code Here

    if (facadeClassName == null) {
      //set the InteractiveOperationsFacade to apply by default
      System.setProperty(FacadeConstants.FACADE_CLASS_NAME, InteractiveOperationsFacade.class.getName());
    }

    CommandState commandState = new CommandState();
    CommandLineInputCapturer inputCapturer = new CommandLineInputCapturer();
    commandState.setInputCapturer(inputCapturer);

    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) {
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp();
        Impala.clear();
        GlobalCommandState.getInstance().reset();
        command = new LoadDefinitionFromClassCommand();
        commandState = new CommandState();
    }
View Full Code Here

    private CommandState commandState;

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        commandState = new CommandState();
        command = new ChangeDirectoryCommand(new StandaloneModuleLocationResolver());
        GlobalCommandState.getInstance().reset();
    }
View Full Code Here

        assertFalse(command.execute(null));
       
        //now load up the module definition properly
        GlobalCommandState.getInstance().addValue(CommandStateConstants.MODULE_DEFINITION_SOURCE, new Test1());

        CommandState commandState = new CommandState();
        //this will cause NoServiceException, because Impala.init() has not been called
        try {
            command.execute(commandState);
        }
        catch (NoServiceException e) {
View Full Code Here

   
    public final void testModuleReload() {
        //now load up the module definition properly
        GlobalCommandState.getInstance().addValue(CommandStateConstants.MODULE_DEFINITION_SOURCE, new Test1());

        CommandState commandState = new CommandState();
        assertTrue(new InitContextCommand().execute(null));

        command.extractText(new String[]{Test1.plugin1}, commandState);
        command.execute(commandState);     
        assertFalse(command.isRootReloaded());
View Full Code Here

TOP

Related Classes of org.impalaframework.command.framework.CommandState

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.