UploadForm extends ProgressForm<byte[]> { public Upload getUpload() { return upload; } UploadForm(UI ui, ProgressMode progressMode, boolean showCancelButton); Upload getUpload();  }
@Test public void testSimpleForm() throws IOException { UploadForm form = new UploadForm(ui, ProgressMode.SIMPLE, false) { private static final long serialVersionUID = -2866860896190814120L; @Override protected void process(byte[] t, int estimatedSize) { assertEquals(3, t.length); } @Override protected String getTitle() { return "Title"; } @Override protected int estimateSize(byte[] t) { return 0; } }; MockUtil.injectUI(form, ui); form.build(); form.getUpload().setAutoUpload(true); form.getUpload().getReceiver().receiveUpload("test.txt", "text/plain"); }