expect(field.getClientId()).andReturn("myfield").anyTimes();
expect(field.getDisplayName()).andReturn("My Field");
FormComponentContributorContext context = newMock(FormComponentContributorContext.class);
Locale locale = Locale.ENGLISH;
expect(context.getLocale()).andReturn(locale).anyTimes();
expect(context.getProfile()).andReturn(json);
context.addInitializationScript(field, "dojo.require(\"tapestry.form.datetime\");");
String strMin = translator.format(field, locale, minDate);
trainFormatMessage(context, null, ValidationStrings.DATE_TOO_EARLY,
new Object[] { "My Field", strMin }, "default message");