298299300301302303304305306307308
Assert.assertEquals("input validator", 1, input.getValidators().length); Validator v = input.getValidators()[0]; v.validate(facesContext, input, "4333"); } @Test public void testValidateDoubleRangeHandler() throws Exception {
315316317318319320321322323324325
Assert.assertEquals("input validator", 1, input.getValidators().length); Validator v = input.getValidators()[0]; v.validate(facesContext, input, new Double(1.8)); } @Test public void testValidateLengthHandler() throws Exception {
332333334335336337338339340341342
Assert.assertEquals("input validator", 1, input.getValidators().length); Validator v = input.getValidators()[0]; v.validate(facesContext, input, "beans"); } @Test public void testValidateLongRangeHandler() throws Exception {
349350351352353354355356357358359
Assert.assertEquals("input validator", 1, input.getValidators().length); Validator v = input.getValidators()[0]; v.validate(facesContext, input, new Long(2000)); } @Test public void testValueChangeListenerHandler() throws Exception {
176177178179180181182183184185186
for (int i = 0; i < validators.length; i++) { Validator validator = validators[i]; try { validator.validate(context, input, convertedValue); } catch (ValidatorException e) { holder.setValid(false); FacesMessage facesMessage = e.getFacesMessage();
259260261262263264265266267268269
for (int i = 0; i < validators.length; i++) { Validator validator = validators[i]; try { validator.validate(context, input, convertedValue); } catch (ValidatorException e) { input.setValid(false);
272273274275276277278279280281282
301302303304305306307308309310311
while (validators.hasNext()) { Validator validator = validators.next(); try { validator.validate(context, this, newValue); } catch (ValidatorException ve) { // If the validator throws an exception, we're // invalid, and we need to add a message
358359360361362363364365366367368