MockRequestContext context = new MockRequestContext();
context.setAttribute("method", "setupForm");
formAction.execute(context);
Errors errors = new FormObjectAccessor(context).getFormErrors("formObject", ScopeType.FLASH);
assertNotNull(errors);
assertEquals(new Long(-1), errors.getFieldValue("prop"));
// this fails because of SWF-193
assertEquals("initialValue", errors.getFieldValue("otherProp"));
context.putRequestParameter("prop", "1");
context.putRequestParameter("otherProp", "value");
context.setAttribute("method", "bind");
formAction.execute(context);
TestBean formObject = (TestBean) new FormObjectAccessor(context).getFormObject("formObject", ScopeType.FLOW);
errors = new FormObjectAccessor(context).getFormErrors("formObject", ScopeType.FLASH);
assertNotNull(formObject);
assertEquals(new Long(1), formObject.getProp());
assertEquals(new Long(1), errors.getFieldValue("prop"));
assertEquals("value", formObject.otherProp);
assertEquals("value", errors.getFieldValue("otherProp"));
}