public void testFileUploadCanBeValidated() throws IOException
{
tester.startPage(TestValidationPage.class);
// creating the file expected by form validators
File tmpFile = writeTestFile(1);
tmpFile.deleteOnExit();
FormTester formtester = tester.newFormTester("form");
formtester.setFile("upload", tmpFile, "text/plain");
formtester.submit();
TestValidationPage page = (TestValidationPage)tester.getLastRenderedPage();
assertFalse(page.getForm().hasError());