errors.getTarget() instanceof OtherTestBean);
assertSame(formObject, errors.getTarget());
}
public void testMultipleFormObjects() throws Exception {
MockRequestContext context = new MockRequestContext(parameters());
FormAction action1 = createFormAction("test1");
action1.setupForm(context);
TestBean test1 = (TestBean) context.getFlowScope().get("test1");
assertNotNull(test1);
assertSame(test1, new FormObjectAccessor(context).getCurrentFormObject());
FormAction action2 = createFormAction("test2");
action2.setupForm(context);
TestBean test2 = (TestBean) context.getFlowScope().get("test2");
assertNotNull(test2);
assertSame(test2, new FormObjectAccessor(context).getCurrentFormObject());
MockParameterMap parameters = new MockParameterMap();
parameters.put("prop", "12345");
context.setExternalContext(new MockExternalContext(parameters));
action1.bindAndValidate(context);
TestBean test11 = (TestBean) context.getFlowScope().get("test1");
assertSame(test1, test11);
assertEquals("12345", test1.getProp());
assertSame(test1, new FormObjectAccessor(context).getCurrentFormObject());
parameters = new MockParameterMap();
parameters.put("prop", "123456");
context.setExternalContext(new MockExternalContext(parameters));
action2.bindAndValidate(context);
TestBean test22 = (TestBean) context.getFlowScope().get("test2");
assertSame(test22, test2);
assertEquals("123456", test2.getProp());
assertSame(test2, new FormObjectAccessor(context).getCurrentFormObject());
}