Package org.richfaces.validator

Examples of org.richfaces.validator.ValidatorDescriptor


    }

    private void setupComponentValidator(Validator... validators) {
        expect(input.getValidators()).andStubReturn(validators);
        for (Validator validator : validators) {
            ValidatorDescriptor validatorDescriptor = environment.createMock(ValidatorDescriptor.class);
            expect((Class) validatorDescriptor.getImplementationClass()).andStubReturn(validator.getClass());
            expect(validatorDescriptor.getMessage()).andStubReturn(VALIDATION_ERROR);
            expect(facesValidatorService.getValidatorDescription(environment.getFacesContext(), input, validator, null))
                .andStubReturn(validatorDescriptor);
        }
    }
View Full Code Here


        setupComponentValidator(validator);
        setupBeanValidator();
        expect(input.getAttributes()).andStubReturn(Collections.<String, Object>emptyMap());
        Collection<ValidatorDescriptor> validators = checkValidator();
        assertEquals(1, validators.size());
        ValidatorDescriptor validatorDescriptor = Iterables.getOnlyElement(validators);
        assertSame(validator.getClass(), validatorDescriptor.getImplementationClass());
        assertEquals(VALIDATION_ERROR, validatorDescriptor.getMessage());
        controller.verify();
    }
View Full Code Here

    public void testBeanValidators() throws Exception {
        setupBeanValidator(beanValidatorDescriptor);
        expect(input.getAttributes()).andStubReturn(Collections.<String, Object>emptyMap());
        Collection<ValidatorDescriptor> validators = checkValidator();
        assertEquals(1, validators.size());
        ValidatorDescriptor validatorDescriptor = Iterables.getOnlyElement(validators);
        assertSame(beanValidatorDescriptor, validatorDescriptor);
        controller.verify();
    }
View Full Code Here

        } else {
            expect(mockBehavior.getConverter(behaviorContext)).andStubReturn(null);
        }
        Collection<ValidatorDescriptor> validatorDescriptors = new ArrayList<ValidatorDescriptor>(validators.length);
        for (Class<?> validator : validators) {
            ValidatorDescriptor validatorDescriptor = controller.createNiceMock(ValidatorDescriptor.class);
            setupDescription(validator, validatorDescriptor);
            validatorDescriptors.add(validatorDescriptor);
        }
        expect(mockBehavior.getValidators(behaviorContext)).andReturn(validatorDescriptors);
        expect(input.getClientId(environment.getFacesContext())).andStubReturn("foo:bar");
View Full Code Here

        } else {
            expect(mockBehavior.getConverter(behaviorContext)).andStubReturn(null);
        }
        Collection<ValidatorDescriptor> validatorDescriptors = new ArrayList<ValidatorDescriptor>(validators.length);
        for (Class<?> validator : validators) {
            ValidatorDescriptor validatorDescriptor = controller.createNiceMock(ValidatorDescriptor.class);
            setupDescription(validator, validatorDescriptor);
            validatorDescriptors.add(validatorDescriptor);
        }
        expect(mockBehavior.getValidators(behaviorContext)).andReturn(validatorDescriptors);
        expect(input.getClientId(environment.getFacesContext())).andStubReturn("foo:bar");
View Full Code Here

TOP

Related Classes of org.richfaces.validator.ValidatorDescriptor

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.