/**
* <p>Verify the presence and contents of a stylesheet element.</p>
*/
public void testStylesheet() throws Exception {
HtmlLink link = null;
Iterator kids = head().getChildElements().iterator();
while (kids.hasNext()) {
HtmlElement kid = (HtmlElement) kids.next();
if (kid instanceof HtmlLink) {
assertNull("Only one stylesheet element present", link);
link = (HtmlLink) kid;
}
}
assertNotNull("Exactly one stylesheet element present", link);
assertEquals("link", link.getTagName());
assertEquals("", link.getCharsetAttribute());
String url = this.url.toString();
url = url.substring(0, url.length() - 1);
url = url.substring(url.lastIndexOf('/'));
assertEquals(url + "/stylesheet.css", link.getHrefAttribute());
assertEquals("", link.getHrefLangAttribute());
assertEquals("", link.getMediaAttribute());
assertEquals("stylesheet", link.getRelAttribute());
assertEquals("", link.getRevAttribute());
assertEquals("", link.getTargetAttribute());
assertEquals("text/css", link.getTypeAttribute());
}