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.xml.sax.SAXException ; 9 10 import com.meterware.httpunit.GetMethodWebRequest; 11 import com.meterware.httpunit.WebForm; 12 13 public class ToolbarTest extends HttpUnitTestCase { 14 15 public ToolbarTest(String arg0) { 16 super(arg0); 17 } 18 19 private void check(String name) 20 throws JaxenException, IOException , SAXException , TransformerException { 21 utils.check(name, "filter.xsl", "form01"); 22 } 23 24 public void testToolbar() throws Exception { 25 GetMethodWebRequest gmw = new GetMethodWebRequest(servletUrl + "/toolbdemo.jsp"); 26 wc.sendRequest(gmw); 27 check("toolb-01"); 28 29 WebForm wf = wc.getCurrentPage().getFormWithID("form01"); 30 wf.submit(wf.getSubmitButton("button1")); 31 check("toolb-02"); 32 33 wf = wc.getCurrentPage().getFormWithID("form01"); 34 wf.submit(wf.getSubmitButton("button2")); 35 check("toolb-03"); 36 37 wf = wc.getCurrentPage().getFormWithID("form01"); 38 wf.submit(wf.getSubmitButton("button3")); 39 check("toolb-04"); 40 41 wf = wc.getCurrentPage().getFormWithID("form01"); 42 wf.submit(wf.getSubmitButton("button4")); 43 check("toolb-05"); 44 45 wf = wc.getCurrentPage().getFormWithID("form01"); 46 wf.submit(wf.getSubmitButton("button4")); 47 check("toolb-06"); 48 } 49 50 } 51 | Popular Tags |