assertEquals("html", html.getTagName());
assertEquals("http://www.w3.org/1999/xhtml", html.getAttributeValue("xmlns"));
assertEquals("logon", title());
HtmlForm form = (HtmlForm) element("form");
assertNotNull(form);
assertEquals("", form.getAcceptAttribute());
assertEquals("", form.getAcceptCharsetAttribute());
String url = this.url.toString();
url = url.substring(0, url.length() - 1);
url = url.substring(url.lastIndexOf('/'));
String action = form.getActionAttribute();
int semicolon = action.indexOf(';');
if (semicolon >= 0) {
action = action.substring(0, semicolon);
}
assertEquals(url + "/logon.faces", action);
assertEquals("", form.getEnctypeAttribute());
assertEquals("post", form.getMethodAttribute());
assertEquals("logonForm", form.getNameAttribute());
assertEquals("", form.getOnResetAttribute());
assertEquals("", form.getOnSubmitAttribute());
assertEquals("", form.getTargetAttribute());
span = (HtmlSpan) element("form:usernamePrompt");
assertNotNull(span);
assertEquals("Username:", span.asText());
HtmlTextInput username = (HtmlTextInput) element("form:username");
assertNotNull(username);
assertEquals("", username.getLangAttribute());
assertEquals("form:username", username.getNameAttribute());
assertEquals("", username.getOnClickAttribute());
assertEquals("", username.getOnDblClickAttribute());
assertEquals("", username.getOnKeyDownAttribute());
assertEquals("", username.getOnKeyPressAttribute());
assertEquals("", username.getOnKeyUpAttribute());
assertEquals("", username.getOnMouseDownAttribute());
assertEquals("", username.getOnMouseMoveAttribute());
assertEquals("", username.getOnMouseOutAttribute());
assertEquals("", username.getOnMouseOverAttribute());
assertEquals("", username.getOnMouseUpAttribute());
assertEquals("text", username.getTypeAttribute());
assertEquals("", username.getValueAttribute());
span = (HtmlSpan) element("form:passwordPrompt");
assertNotNull(span);
assertEquals("Password:", span.asText());
HtmlPasswordInput password = (HtmlPasswordInput)
element("form:password");
assertNotNull(password);
assertEquals("", password.getLangAttribute());
assertEquals("form:password", password.getNameAttribute());
assertEquals("", password.getOnClickAttribute());
assertEquals("", password.getOnDblClickAttribute());
assertEquals("", password.getOnKeyDownAttribute());
assertEquals("", password.getOnKeyPressAttribute());
assertEquals("", password.getOnKeyUpAttribute());
assertEquals("", password.getOnMouseDownAttribute());
assertEquals("", password.getOnMouseMoveAttribute());
assertEquals("", password.getOnMouseOutAttribute());
assertEquals("", password.getOnMouseOverAttribute());
assertEquals("", password.getOnMouseUpAttribute());
assertEquals("password", password.getTypeAttribute());
assertEquals("", password.getValueAttribute());
HtmlSubmitInput submit = (HtmlSubmitInput) element("form:submit");
assertNotNull(submit);
assertEquals("", submit.getLangAttribute());
assertEquals("form:submit", submit.getNameAttribute());
assertEquals("", submit.getOnClickAttribute());
assertEquals("", submit.getOnDblClickAttribute());
assertEquals("", submit.getOnKeyDownAttribute());
assertEquals("", submit.getOnKeyPressAttribute());
assertEquals("", submit.getOnKeyUpAttribute());
assertEquals("", submit.getOnMouseDownAttribute());
assertEquals("", submit.getOnMouseMoveAttribute());
assertEquals("", submit.getOnMouseOutAttribute());
assertEquals("", submit.getOnMouseOverAttribute());
assertEquals("", submit.getOnMouseUpAttribute());
assertEquals("submit", submit.getTypeAttribute());
assertEquals("Logon", submit.getValueAttribute());
HtmlResetInput reset = (HtmlResetInput) element("form:reset");
assertNotNull(reset);
assertEquals("", reset.getLangAttribute());
assertEquals("form:reset", reset.getNameAttribute());
assertEquals("", reset.getOnClickAttribute());
assertEquals("", reset.getOnDblClickAttribute());
assertEquals("", reset.getOnKeyDownAttribute());
assertEquals("", reset.getOnKeyPressAttribute());
assertEquals("", reset.getOnKeyUpAttribute());
assertEquals("", reset.getOnMouseDownAttribute());
assertEquals("", reset.getOnMouseMoveAttribute());
assertEquals("", reset.getOnMouseOutAttribute());
assertEquals("", reset.getOnMouseOverAttribute());
assertEquals("", reset.getOnMouseUpAttribute());
assertEquals("reset", reset.getTypeAttribute());
assertEquals("Reset", reset.getValueAttribute());
HtmlSubmitInput cancel = (HtmlSubmitInput) element("form:cancel");
assertNotNull(cancel);
assertEquals("", cancel.getLangAttribute());
assertEquals("form:cancel", cancel.getNameAttribute());
assertEquals("", cancel.getOnClickAttribute());
assertEquals("", cancel.getOnDblClickAttribute());
assertEquals("", cancel.getOnKeyDownAttribute());
assertEquals("", cancel.getOnKeyPressAttribute());
assertEquals("", cancel.getOnKeyUpAttribute());
assertEquals("", cancel.getOnMouseDownAttribute());
assertEquals("", cancel.getOnMouseMoveAttribute());
assertEquals("", cancel.getOnMouseOutAttribute());
assertEquals("", cancel.getOnMouseOverAttribute());
assertEquals("", cancel.getOnMouseUpAttribute());
assertEquals("submit", cancel.getTypeAttribute());
assertEquals("Cancel", cancel.getValueAttribute());
HtmlAnchor anchor = (HtmlAnchor) element("form:submit2");
assertNotNull(anchor);
assertEquals("", anchor.getAccessKeyAttribute());
assertEquals("", anchor.getCharsetAttribute());
assertEquals("", anchor.getClassAttribute());
assertEquals("", anchor.getCoordsAttribute());
assertEquals("#", anchor.getHrefAttribute());
assertEquals("form:submit2", anchor.getIdAttribute());
assertEquals("", anchor.getLangAttribute());
assertEquals("", anchor.getHrefLangAttribute());
assertEquals("", anchor.getOnBlurAttribute());
assertTrue
(anchor.getOnClickAttribute().startsWith
("document.forms['form']" +
"['org_apache_struts_faces_renderer_CommandLinkRenderer']" +
".value='form:submit2';"));
assertEquals("", anchor.getOnDblClickAttribute());
assertEquals("", anchor.getOnKeyDownAttribute());
assertEquals("", anchor.getOnKeyPressAttribute());
assertEquals("", anchor.getOnKeyUpAttribute());
assertEquals("", anchor.getOnMouseDownAttribute());
assertEquals("", anchor.getOnMouseMoveAttribute());
assertEquals("", anchor.getOnMouseOutAttribute());
assertEquals("", anchor.getOnMouseOverAttribute());
assertEquals("", anchor.getOnMouseUpAttribute());
assertEquals("", anchor.getTextDirectionAttribute());
assertEquals("", anchor.getXmlLangAttribute());
assertEquals("", anchor.getOnFocusAttribute());
assertEquals("", anchor.getRelAttribute());
assertEquals("", anchor.getRevAttribute());
assertEquals("", anchor.getShapeAttribute());
assertEquals("", anchor.getStyleAttribute());
assertEquals("", anchor.getTabIndexAttribute());
assertEquals("a", anchor.getTagName());
assertEquals("", anchor.getTargetAttribute());
assertEquals("", anchor.getTitleAttribute());
assertEquals("", anchor.getTypeAttribute());
assertEquals("Logon", anchor.asText());
List list = form.getHtmlElementsByAttribute
("input", "name",
"org_apache_struts_faces_renderer_CommandLinkRenderer");
assertNotNull(list);
assertEquals(1, list.size());
HtmlHiddenInput hidden = (HtmlHiddenInput) list.get(0);