@SuppressWarnings({"unchecked"}) @Test public void event_triggered_after_delegate_invoked() throws Exception { getMocksControl().checkOrder(true); ComponentResources resources = mockComponentResources(); FieldValidator fv = mockFieldValidator(); Object value = new Object(); fv.validate(value); ComponentEventCallback handler = null; expect(resources.triggerEvent(EasyMock.eq(EventConstants.VALIDATE), EasyMock.aryEq(new Object[]{value}), EasyMock.eq(handler))).andReturn(true); replay(); FieldValidationSupport support = new FieldValidationSupportImpl(typeCoercer, propertyAccess); support.validate(value, resources, fv); verify(); }
@SuppressWarnings( {"unchecked"}) public void validate(Object value, ComponentResources componentResources, FieldValidator validator) throws ValidationException { assert componentResources != null; assert validator != null; validator.validate(value); try { componentResources.triggerEvent(EventConstants.VALIDATE, new Object[] {value}, null); } catch (RuntimeException ex) { rethrowValidationException(ex); } }
FieldValidationSupportImpl implements FieldValidationSupport { @SuppressWarnings( {"unchecked"}) public void validate(Object value, ComponentResources componentResources, FieldValidator validator) throws ValidationException { assert componentResources != null; assert validator != null; validator.validate(value); try { componentResources.triggerEvent(EventConstants.VALIDATE, new Object[] {value}, null); } catch (RuntimeException ex) { rethrowValidationException(ex); } } }
FieldValidationSupportImpl implements FieldValidationSupport { @SuppressWarnings( {"unchecked"}) public void validate(Object value, ComponentResources componentResources, FieldValidator validator) throws ValidationException { assert componentResources != null; assert validator != null; validator.validate(value); try { componentResources.triggerEvent(EventConstants.VALIDATE, new Object[] {value}, null); } catch (RuntimeException ex) { rethrowValidationException(ex); } } FieldValidationSupportImpl(TypeCoercer typeCoercer, PropertyAccess propertyAccess); }
FieldValidationSupportImpl implements FieldValidationSupport { @SuppressWarnings( {"unchecked"}) public void validate(Object value, ComponentResources componentResources, FieldValidator validator) throws ValidationException { assert componentResources != null; assert validator != null; validator.validate(value); try { componentResources.triggerEvent(EventConstants.VALIDATE, new Object[] {value}, null); } catch (RuntimeException ex) { rethrowValidationException(ex); } } FieldValidationSupportImpl(TypeCoercer typeCoercer, PropertyAccess propertyAccess); String toClient(Object value, ComponentResources componentResources, FieldTranslator<Object> translator,
                           NullFieldStrategy nullFieldStrategy); Object parseClient(String clientValue, ComponentResources componentResources,
                              FieldTranslator<Object> translator, NullFieldStrategy nullFieldStrategy); @SuppressWarnings( {"unchecked"}) void validate(Object value, ComponentResources componentResources, FieldValidator validator); }
FieldValidationSupportImpl implements FieldValidationSupport { @SuppressWarnings( {"unchecked"}) public void validate(Object value, ComponentResources componentResources, FieldValidator validator) throws ValidationException { assert componentResources != null; assert validator != null; validator.validate(value); try { componentResources.triggerEvent(EventConstants.VALIDATE, new Object[] {value}, null); } catch (RuntimeException ex) { rethrowValidationException(ex); } } FieldValidationSupportImpl(TypeCoercer typeCoercer, PropertyAccess propertyAccess); String toClient(Object value, ComponentResources componentResources, FieldTranslator<Object> translator,
                           NullFieldStrategy nullFieldStrategy); Object parseClient(String clientValue, ComponentResources componentResources,
                              FieldTranslator<Object> translator, NullFieldStrategy nullFieldStrategy); @SuppressWarnings( {"unchecked"}) void validate(Object value, ComponentResources componentResources, FieldValidator validator);  }