public void testSubmitLinkByUsingFormTester()
{
tester.startPage(HomePage.class);
tester.assertRenderedPage(HomePage.class);
HomePage home = (HomePage)tester.getLastRenderedPage();
FormTester formTester = tester.newFormTester("form");
formTester.setValue("text", "Hello");
formTester.submit("link");
assertEquals("Hello", home.getText());
assertTrue("Form.onSubmit() has not been called!", home.isSubmitted());
assertTrue("SubmitLink.onSubmit() has not been called!",
home.isSubmittedViaLinkBefore());
assertTrue("SubmitLink.onAfterSubmit() has not been called!",