Package org.impalaframework.command.framework

Examples of org.impalaframework.command.framework.CommandInfo.validate()


        CommandDefinition commandDefinition = command.getCommandDefinition();
        assertEquals(1, commandDefinition.getCommandInfos().size());
        CommandInfo ci = commandDefinition.getCommandInfos().get(0);
       
        String numberErrorMessage = "Invalid Selection. Selected number does not correspond with one of the values.\nPlease select a number between 1 and 2";
        assertEquals(numberErrorMessage, ci.validate("-1"));
        assertEquals(numberErrorMessage, ci.validate("3"));
       
        String alphaErrorMessage = "Invalid Selection. Please select a number corresponding with one of the alternative choices";
        assertEquals(alphaErrorMessage , ci.validate("a value"));
        assertEquals(null, ci.validate("2"));
View Full Code Here


        assertEquals(1, commandDefinition.getCommandInfos().size());
        CommandInfo ci = commandDefinition.getCommandInfos().get(0);
       
        String numberErrorMessage = "Invalid Selection. Selected number does not correspond with one of the values.\nPlease select a number between 1 and 2";
        assertEquals(numberErrorMessage, ci.validate("-1"));
        assertEquals(numberErrorMessage, ci.validate("3"));
       
        String alphaErrorMessage = "Invalid Selection. Please select a number corresponding with one of the alternative choices";
        assertEquals(alphaErrorMessage , ci.validate("a value"));
        assertEquals(null, ci.validate("2"));
    }
View Full Code Here

        String numberErrorMessage = "Invalid Selection. Selected number does not correspond with one of the values.\nPlease select a number between 1 and 2";
        assertEquals(numberErrorMessage, ci.validate("-1"));
        assertEquals(numberErrorMessage, ci.validate("3"));
       
        String alphaErrorMessage = "Invalid Selection. Please select a number corresponding with one of the alternative choices";
        assertEquals(alphaErrorMessage , ci.validate("a value"));
        assertEquals(null, ci.validate("2"));
    }

    protected CommandLineInputCapturer getInputCapturer() {
        CommandLineInputCapturer inputCapturer = new CommandLineInputCapturer(){
View Full Code Here

        assertEquals(numberErrorMessage, ci.validate("-1"));
        assertEquals(numberErrorMessage, ci.validate("3"));
       
        String alphaErrorMessage = "Invalid Selection. Please select a number corresponding with one of the alternative choices";
        assertEquals(alphaErrorMessage , ci.validate("a value"));
        assertEquals(null, ci.validate("2"));
    }

    protected CommandLineInputCapturer getInputCapturer() {
        CommandLineInputCapturer inputCapturer = new CommandLineInputCapturer(){
            @Override
View Full Code Here

        assertEquals(1, commandDefinition.getCommandInfos().size());
        CommandInfo ci = commandDefinition.getCommandInfos().get(0);

        String nullOrEmptyText = "Please enter type (class or interface) to find";
        try {
            assertEquals(nullOrEmptyText, ci.validate(null));
            fail();
        }
        catch (IllegalArgumentException e) {
        }
        assertEquals("Search text should be at least 3 characters long", ci.validate("a"));
View Full Code Here

            assertEquals(nullOrEmptyText, ci.validate(null));
            fail();
        }
        catch (IllegalArgumentException e) {
        }
        assertEquals("Search text should be at least 3 characters long", ci.validate("a"));

    }

    public void testFindClass() throws Exception {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.