Search in sources :

Example 1 with HtmlParameter

use of com.gargoylesoftware.htmlunit.html.HtmlParameter in project maven-doxia-sitetools by apache.

the class MiscVerifier method verify.

/**
 * {@inheritDoc}
 */
public void verify(String file) throws Exception {
    HtmlPage page = htmlPage(file);
    assertNotNull(page);
    HtmlElement element = page.getHtmlElementById("contentBox");
    assertNotNull(element);
    HtmlDivision division = (HtmlDivision) element;
    assertNotNull(division);
    Iterator<HtmlElement> elementIterator = division.getHtmlElementDescendants().iterator();
    // ----------------------------------------------------------------------
    // 
    // ----------------------------------------------------------------------
    HtmlUnknownElement applet = (HtmlUnknownElement) elementIterator.next();
    assertEquals("org.micro.applet.Main", applet.getAttribute("code"));
    assertEquals("micro-applet.jar", applet.getAttribute("archive"));
    HtmlParameter param = (HtmlParameter) elementIterator.next();
    assertEquals("midlet", param.getAttribute("name"));
    assertEquals("org.micro.applet.SimpleDemoMIDlet", param.getAttribute("value"));
}
Also used : HtmlPage(com.gargoylesoftware.htmlunit.html.HtmlPage) HtmlElement(com.gargoylesoftware.htmlunit.html.HtmlElement) HtmlDivision(com.gargoylesoftware.htmlunit.html.HtmlDivision) HtmlUnknownElement(com.gargoylesoftware.htmlunit.html.HtmlUnknownElement) HtmlParameter(com.gargoylesoftware.htmlunit.html.HtmlParameter)

Aggregations

HtmlDivision (com.gargoylesoftware.htmlunit.html.HtmlDivision)1 HtmlElement (com.gargoylesoftware.htmlunit.html.HtmlElement)1 HtmlPage (com.gargoylesoftware.htmlunit.html.HtmlPage)1 HtmlParameter (com.gargoylesoftware.htmlunit.html.HtmlParameter)1 HtmlUnknownElement (com.gargoylesoftware.htmlunit.html.HtmlUnknownElement)1