import junit.framework.TestCase;
public class FormDataPopulatorTest extends TestCase {
public void testPerson(){
FormDataPopulator pop = new FormDataPopulator();
Person p = new Person();
MockHttpRequest request = new MockHttpRequest();
request.parameters.put("name"+FormHandler.VAR_NAME_POSTFIX,"me");
request.parameters.put("age"+FormHandler.VAR_NAME_POSTFIX,"12");
request.parameters.put("isMale"+FormHandler.VAR_NAME_POSTFIX,"false");
request.parameters.put("hidden","notshown");
pop.populate(request, p);
assertEquals(p.name, "me");
assertEquals(p.age, 12);
assertEquals(p.isMale, false);
}