}
@Test
public void field_error()
{
MarkupWriter writer = new MarkupWriterImpl(new XMLMarkupModel());
Environment env = mockEnvironment();
Field field = mockField();
ValidationTracker tracker = mockValidationTracker();
train_peekRequired(env, ValidationTracker.class, tracker);
train_inError(tracker, field, true);
replay();
writer.element("input", "type", "text", "name", "ex", "class", "foo", "value", "freddy", "size", "30");
ValidationDecorator decorator = new DefaultValidationDecorator(env, null, null, writer);
decorator.insideField(field);
assertEquals(writer.toString(),
"<?xml version=\"1.0\"?>\n<input class=\"foo t-error\" name=\"ex\" size=\"30\" type=\"text\" value=\"freddy\"/>");
verify();
}