*/
public void testDouble() throws Exception {
// Save the current page so we can resubmit it
HtmlPage save = this.page;
HtmlElement message = null;
String text = null;
// setUp() should have put us on the page
assertEquals("Shale Token Test", title());
// Fill in the required value and submit the form
HtmlTextInput value = (HtmlTextInput) element("form:value");
value.setValueAttribute("Value");
HtmlSubmitInput submit = (HtmlSubmitInput) element("form:submit");
submit(submit);
// Restore the saved page and submit it again
this.page = save;
value = (HtmlTextInput) element("form:value");
value.setValueAttribute("Value");
submit = (HtmlSubmitInput) element("form:submit");
submit(submit);
// Verify we stayed on the same page with appropriate error messages
assertEquals("Shale Token Test", title());
HtmlElement messages = element("form:messages");
assertNotNull(messages);
text = messages.asText();
assertTrue(text.indexOf("Invalid resubmit (summary)") != -1);
message = element("form:valueMessage");
assertNull(message);
message = element("form:tokenMessage");
assertNotNull(message);