@Test
public void testHandleFormMultiTimes()
{
SimpleStrutsForm form1 = new SimpleStrutsForm();
DelegatingForm delegator1 = new DelegatingForm(form1);
SimpleStrutsForm form2 = new SimpleStrutsForm();
DelegatingForm delegator2 = new DelegatingForm(form2);
HttpServletRequest request = createMock(HttpServletRequest.class);
replay(request);
FormWrapper delegate = new ValidateBindFormWrapper();
delegate.handleValidForm(delegator1, request);
delegate.handleValidForm(delegator2, request);
delegate.handleBindingForm(delegator1, request);
delegate.handleBindingForm(delegator2, request);
assert null != delegator1.getBindConvertInfo();
assert null != delegator2.getValidationInfo();
// now check that the same instances are used for each invocation
assert delegator1.getBindConvertInfo() == delegator2.getBindConvertInfo();
assert delegator1.getValidationInfo() == delegator2.getValidationInfo();
verify(request);
}