Package org.apache.commons.validator

Examples of org.apache.commons.validator.ValidatorAction


        //set the value
        component1.setSubmittedValue("123Test");
        // invoke component validation
        component1.validate(facesContext);
                     
        ValidatorAction va = CommonsValidator.getValidatorAction("mask");
        assertNotNull("validator action", va);
        String actualMsg = messages.getMessage(va.getMsg(),
                facesContext.getViewRoot().getLocale(),
                new Object[] {component1.getId()});
       
        // check for a error message
        checkMessage(actualMsg, component1);
View Full Code Here


        //set the value
        component1.setSubmittedValue("129");
        // invoke component validation
        component1.validate(facesContext);
                       
        ValidatorAction va = CommonsValidator.getValidatorAction("byte");
        assertNotNull("validator action", va);
        String actualMsg = messages.getMessage(va.getMsg(),
                facesContext.getViewRoot().getLocale(),
                new Object[] {component1.getId()});
       
        // check for a error message
        checkMessage(actualMsg, component1);
View Full Code Here

        //set the value
        component1.setSubmittedValue("32768");
        // invoke component validation
        component1.validate(facesContext);
                       
        ValidatorAction va = CommonsValidator.getValidatorAction("short");
        assertNotNull("validator action", va);
        String actualMsg = messages.getMessage(va.getMsg(),
                facesContext.getViewRoot().getLocale(),
                new Object[] {component1.getId()});
       
        // check for a error message
        checkMessage(actualMsg, component1);
View Full Code Here

        //set the value
        component1.setSubmittedValue("2147483648");
        // invoke component validation
        component1.validate(facesContext);
                       
        ValidatorAction va = CommonsValidator.getValidatorAction("integer");
        assertNotNull("validator action", va);
        String actualMsg = messages.getMessage(va.getMsg(),
                facesContext.getViewRoot().getLocale(),
                new Object[] {component1.getId()});
       
        // check for a error message
        checkMessage(actualMsg, component1);
View Full Code Here

        //set the value
        component1.setSubmittedValue("ABCD");
        // invoke component validation
        component1.validate(facesContext);
                       
        ValidatorAction va = CommonsValidator.getValidatorAction("float");
        assertNotNull("validator action", va);
        String actualMsg = messages.getMessage(va.getMsg(),
                facesContext.getViewRoot().getLocale(),
                new Object[] {component1.getId()});
       
        // check for a error message
        checkMessage(actualMsg, component1);
View Full Code Here

        //set the value
        component1.setSubmittedValue("ABCD");
        // invoke component validation
        component1.validate(facesContext);
                       
        ValidatorAction va = CommonsValidator.getValidatorAction("double");
        assertNotNull("validator action", va);
        String actualMsg = messages.getMessage(va.getMsg(),
                facesContext.getViewRoot().getLocale(),
                new Object[] {component1.getId()});
       
        // check for a error message
        checkMessage(actualMsg, component1);
View Full Code Here

        //set the value
        component1.setSubmittedValue("99999999999999999999999999999999999999999999999999999999");
        // invoke component validation
        component1.validate(facesContext);
                       
        ValidatorAction va = CommonsValidator.getValidatorAction("long");
        assertNotNull("validator action", va);
        String actualMsg = messages.getMessage(va.getMsg(),
                facesContext.getViewRoot().getLocale(),
                new Object[] {component1.getId()});
       
        // check for a error message
        checkMessage(actualMsg, component1);
View Full Code Here

        //set the value
        component1.setSubmittedValue("04/31/2006");
        // invoke component validation
        component1.validate(facesContext);
                       
        ValidatorAction va = CommonsValidator.getValidatorAction("date");
        assertNotNull("validator action", va);
        String actualMsg = messages.getMessage(va.getMsg(),
                facesContext.getViewRoot().getLocale(),
                new Object[] {component1.getId()});
       
        // check for a error message
        checkMessage(actualMsg, component1);
View Full Code Here

                       
        // check for a error message
        String min = (String) validator1.getVars().get(CommonsValidator.MIN_VARNAME);
        String max = (String) validator1.getVars().get(CommonsValidator.MAX_VARNAME);
       
        ValidatorAction va = CommonsValidator.getValidatorAction("intRange");
        assertNotNull("validator action", va);
        String actualMsg = messages.getMessage(va.getMsg(),
                facesContext.getViewRoot().getLocale(),
                new Object[] {component1.getId(), min, max});
       
        // check for a error message
        checkMessage(actualMsg, component1);
View Full Code Here

        component1.validate(facesContext);
                       
        // check for a error message
        String min = (String) validator1.getVars().get(CommonsValidator.MIN_VARNAME);
        String max = (String) validator1.getVars().get(CommonsValidator.MAX_VARNAME);
        ValidatorAction va = CommonsValidator.getValidatorAction("floatRange");
        assertNotNull("validator action", va);
        String actualMsg = messages.getMessage(va.getMsg(),
                facesContext.getViewRoot().getLocale(),
                new Object[] {component1.getId(), min, max});
       
        // check for a error message
        checkMessage(actualMsg, component1);
View Full Code Here

TOP

Related Classes of org.apache.commons.validator.ValidatorAction

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.