Package org.impalaframework.command.framework

Examples of org.impalaframework.command.framework.CommandState


        GlobalCommandState.getInstance().reset();
        super.setUp();
        ModuleLocationResolver moduleLocationResolver = new StandaloneModuleLocationResolver();
        runTestCommand = new RunTestCommand(moduleLocationResolver);
        rerunTestCommand = new RerunTestCommand(moduleLocationResolver);
        commandState = new CommandState();
        GlobalCommandState.getInstance().reset();
        Impala.clear();
    }
View Full Code Here


        System.setProperty(LocationConstants.MODULE_TEST_DIR_PROPERTY, "testbin");
        Impala.clear();
        GlobalCommandState.getInstance().reset();
        fromClassCommand = new LoadDefinitionFromClassCommand();
        fromClassNameCommand = new LoadDefinitionFromClassNameCommand(new StandaloneModuleLocationResolver());
        commandState = new CommandState();
        setInputCapturer();
        GlobalCommandState.getInstance().addValue(CommandStateConstants.DIRECTORY_NAME, "impala-interactive");
    }
View Full Code Here

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        command = new LoadTestClassContextCommand();
        commandState = new CommandState();
        GlobalCommandState.getInstance().reset();
    }
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

        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

        doTest(command);
    }

    protected boolean doTest(SelectMethodCommand command) throws ClassNotFoundException {
        // now need to capture
        CommandState commandState = new CommandState();

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

        commandState.capture(command);
        boolean result = command.execute(commandState);
       
        System.out.println("Selected alternative: " + command.getMethodName());
        return result;
    }
View Full Code Here

    public void testFindClass() throws Exception {

        ClassFindCommand command = getCommand();

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

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

        while (true) {

            System.out.println("--------------------");
           
            commandState.capture(command);
            command.execute(commandState);

            List<String> foundClasses = command.getFoundClasses();

            for (String className : foundClasses) {
                // check that we can instantiate classes
                System.out.println(className);
            }
           
            if (foundClasses.size() >= 2)
            {
                AlternativeInputCommand altInputCommand = new AlternativeInputCommand(foundClasses.toArray(new String[foundClasses.size()]));
                commandState.capture(altInputCommand);
                altInputCommand.execute(commandState);
               
                System.out.println("Selected class: " + altInputCommand.getSelectedAlternative());
            }
            else if (foundClasses.size() == 1)
View Full Code Here

        doTest(command);
    }

    protected void doTest(SearchClassCommand command) throws ClassNotFoundException {
        // now need to capture
        CommandState commandState = new CommandState();

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

        commandState.capture(command);
        command.execute(commandState);
       
        System.out.println("Selected alternative: " + command.getClassName());
    }
View Full Code Here

    private void doTest(AlternativeInputCommand command) throws ClassNotFoundException {

        System.out.println("----");
        // now need to capture
        CommandState commandState = new CommandState();

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

        commandState.capture(command);
        command.execute(commandState);
       
        System.out.println("Selected alternative: " + command.getSelectedAlternative());
    }
View Full Code Here

        GlobalCommandState.getInstance().reset();
       
        System.out.println("----");
        // now need to capture
        CommandState commandState = new CommandState();

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

        commandState.capture(command);
        command.execute(commandState);

        List<String> foundClasses = command.getFoundClasses();

        for (String className : foundClasses) {
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.