KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tonbeller > wcf > web > TableFormTest


1 package com.tonbeller.wcf.web;
2
3 import java.io.IOException JavaDoc;
4
5 import javax.xml.transform.TransformerException JavaDoc;
6
7 import org.jaxen.JaxenException;
8 import org.xml.sax.SAXException JavaDoc;
9
10 import com.meterware.httpunit.GetMethodWebRequest;
11 import com.meterware.httpunit.WebForm;
12
13 public class TableFormTest extends HttpUnitTestCase {
14
15   public TableFormTest(String JavaDoc arg0) {
16     super(arg0);
17   }
18   
19   private void check(String JavaDoc name) throws JaxenException, IOException JavaDoc, SAXException JavaDoc, TransformerException JavaDoc {
20     utils.check(name, "filter.xsl", "form01");
21   }
22   
23   public void testTable() throws Exception JavaDoc {
24     wc.sendRequest(new GetMethodWebRequest(servletUrl + "/tableform.jsp"));
25     check("tableform-01");
26     
27     // sort Date, assert that form input is not lost
28
WebForm wf = utils.getForm("form01");
29     wf.setParameter("string", "string 2");
30     utils.submitCell("form01", "tableform.table", 0, 2, 0);
31     check("tableform-02");
32
33     // check all, assert that form input is not lost
34
wf = utils.getForm("form01");
35     wf.setParameter("string", "string 3");
36     utils.submitCell("form01", "tableform.table", 0, 0, 0);
37     check("tableform-03");
38
39     // goto last page, assert that form input is not lost
40
wf = utils.getForm("form01");
41     wf.setParameter("string", "string 4");
42     utils.submitCell("form01", "tableform.table", 11, 0, 1);
43     check("tableform-04");
44     
45   }
46
47 }
48
Popular Tags