Package org.apache.myfaces.extensions.validator.baseval.annotation

Examples of org.apache.myfaces.extensions.validator.baseval.annotation.Required


    public void testParameterStyleOne() throws Exception
    {
        ValidationParameterExtractor extractor = new DefaultValidationParameterExtractor();

        TestPerson person = new TestPerson();
        Required required = person.getClass().getDeclaredField("firstName").getAnnotation(Required.class);

        assertNotNull(extractor.extract(required).containsKey(ViolationSeverity.class));
        assertNotNull(extractor.extract(required, ViolationSeverity.class).iterator().next());
        assertEquals(FacesMessage.SEVERITY_WARN, extractor.extract(required, ViolationSeverity.class).iterator().next());
    }
View Full Code Here


    public void testParameterStyleTwo() throws Exception
    {
        ValidationParameterExtractor extractor = new DefaultValidationParameterExtractor();

        TestPerson person = new TestPerson();
        Required required = person.getClass().getDeclaredField("lastName").getAnnotation(Required.class);

        assertNotNull(extractor.extract(required).containsKey("client_side_validation_support"));
        assertNotNull(extractor.extract(required, "client_side_validation_support").iterator().next());
        assertEquals(false, extractor.extract(required, "client_side_validation_support").iterator().next());
    }
View Full Code Here

    public void testParameterStyleThree() throws Exception
    {
        ValidationParameterExtractor extractor = new DefaultValidationParameterExtractor();

        TestPerson person = new TestPerson();
        Required required = person.getClass().getDeclaredField("lastName").getAnnotation(Required.class);

        assertNotNull(extractor.extract(required).containsKey(TestPriority.class));
        assertNotNull(extractor.extract(required, TestPriority.class).iterator().next());
        assertEquals(new Integer(1), extractor.extract(required, TestPriority.class, Integer.class).iterator().next());
        assertEquals(2, extractor.extract(required, TestPriority.class, String.class).size());
View Full Code Here

    public void testParameterStyleFour() throws Exception
    {
        ValidationParameterExtractor extractor = new DefaultValidationParameterExtractor();

        TestPerson person = new TestPerson();
        Required required = person.getClass().getDeclaredField("lastName").getAnnotation(Required.class);

        assertNotNull(extractor.extract(required).containsKey(PropertyValidationInterceptor.class));
        assertNotNull(extractor.extract(required, PropertyValidationInterceptor.class).iterator().next());
        assertEquals(1, extractor.extract(required, PropertyValidationInterceptor.class).size());
        assertEquals(TestValidationInterceptor.class.getName(), extractor.extract(required, PropertyValidationInterceptor.class, PropertyValidationInterceptor.class).iterator().next().getClass().getName());
View Full Code Here

    public void testParameterStyleFive() throws Exception
    {
        ValidationParameterExtractor extractor = new DefaultValidationParameterExtractor();

        TestPerson person = new TestPerson();
        Required required = person.getClass().getDeclaredField("lastName").getAnnotation(Required.class);

        assertNotNull(extractor.extract(required).containsKey(DisableClientSideValidation.class));
        assertNotNull(extractor.extract(required, DisableClientSideValidation.class).iterator().next());
        assertEquals(1, extractor.extract(required, DisableClientSideValidation.class).size());
        assertEquals(1, extractor.extract(required, DisableClientSideValidation.class, Class.class).size());
View Full Code Here

TOP

Related Classes of org.apache.myfaces.extensions.validator.baseval.annotation.Required

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.