public void testTooLarge()
{
// since the pattern has not been set it will be null
// let us push some arbitary value
Mock mock = mock(UIComponent.class);
UIComponent component = (UIComponent) mock.proxy();
MockUIComponentWrapper wrapper = new MockUIComponentWrapper(mock, component);
setMockLabelForComponent(wrapper);
try
{
LongRangeValidator validator = new LongRangeValidator();
validator.setMaximum(100);
validator.validate(facesContext, component, 1000);
// test fails if it is here
fail("Expected Null pointer exception");
}
catch (ValidatorException ve)
{
// suppress it - this is as expected
}
mock.verify();
}