1 package com.tonbeller.wcf.web; 2 3 import java.io.IOException ; 4 5 import javax.xml.transform.TransformerException ; 6 7 import org.jaxen.JaxenException; 8 import org.jaxen.dom.DOMXPath; 9 import org.w3c.dom.Document ; 10 import org.xml.sax.SAXException ; 11 12 import com.meterware.httpunit.GetMethodWebRequest; 13 14 public class WizardTest extends HttpUnitTestCase { 15 String formId = "form01"; 16 public WizardTest(String arg0) { 17 super(arg0); 18 } 19 20 private void check(String name) throws JaxenException, IOException , SAXException , TransformerException { 21 utils.check(name, "filter.xsl", formId); 22 } 23 24 public void testStatusLine() throws Exception { 25 wc.sendRequest(new GetMethodWebRequest(servletUrl + "/wizard.jsp")); 26 check("wizard-01"); 27 28 utils.submitButton(formId, "wizform01.next"); 30 check("wizard-02"); 31 32 utils.getForm(formId).setParameter("stringID", "AB"); 34 utils.submitButton(formId, "wizform01.next"); 35 check("wizard-03"); 36 37 utils.getForm(formId).setParameter("intID", "xx"); 39 utils.submitButton(formId, "wizform02.next"); 40 check("wizard-04"); 41 42 utils.getForm(formId).setParameter("intID", "123"); 44 utils.submitButton(formId, "wizform02.next"); 45 check("wizard-05"); 46 47 utils.submitButton(formId, "wizform03.finish"); 49 Document dom = wc.getCurrentPage().getDOM(); 50 DOMXPath dx = new DOMXPath("//body[@id='index']"); 51 assertEquals("index page expected", 1, dx.selectNodes(dom).size()); 52 } 53 54 } 55 | Popular Tags |