/**
* Test TextField onProcess behavior.
*/
public void testOnProcess() {
MockContext context = MockContext.initContext();
MockRequest request = context.getMockRequest();
TextField textField = new TextField("text");
assertEquals("text", textField.getName());
request.getParameterMap().put("text", "textvalue");
assertTrue(textField.onProcess());
assertTrue(textField.isValid());
assertEquals("textvalue", textField.getValue());
assertEquals("textvalue", textField.getValueObject());
request.getParameterMap().put("text", "");
assertTrue(textField.onProcess());
assertTrue(textField.isValid());
assertEquals("", textField.getValue());
assertEquals(null, textField.getValueObject());
textField.setRequired(true);
assertTrue(textField.onProcess());
assertFalse(textField.isValid());
assertEquals("", textField.getValue());
assertEquals(null, textField.getValueObject());
request.getParameterMap().put("text", "ratherlongtextvalue");
textField.setMinLength(10);
assertTrue(textField.onProcess());
assertTrue(textField.isValid());
assertEquals("ratherlongtextvalue", textField.getValue());