1 package com.tonbeller.wcf.web; 2 3 import java.io.IOException ; 4 import java.net.MalformedURLException ; 5 6 import javax.xml.transform.TransformerException ; 7 8 import org.jaxen.JaxenException; 9 import org.xml.sax.SAXException ; 10 11 import com.meterware.httpunit.GetMethodWebRequest; 12 16 public class Tree3Test extends HttpUnitTestCase { 17 18 public Tree3Test(String arg0) { 19 super(arg0); 20 } 21 22 private void check(String name) throws JaxenException, IOException , SAXException , TransformerException { 23 utils.check(name, "filter.xsl", "form01"); 24 } 25 private void click(int row, int but) throws JaxenException, IOException , SAXException { 26 utils.submitCell("form01", "tree03", row, 0, but); 27 } 28 29 void start() throws MalformedURLException , IOException , SAXException { 30 GetMethodWebRequest req = new GetMethodWebRequest(servletUrl + "/treedemo3.jsp"); 31 req.setParameter("init", "true"); 32 wc.sendRequest(req); 33 } 34 35 public void testTreeCutPaste1() throws Exception { 36 start(); 37 check("tree3-01"); 38 click(0, 0); 40 check("tree3-02"); 41 click(1, 1); 43 check("tree3-03"); 44 click(2, 1); 45 check("tree3-04"); 46 } 47 48 public void testTreeCutPaste2() throws Exception { 49 start(); 50 click(0, 0); 52 click(2, 0); 53 click(1, 0); 54 click(2, 0); 55 check("tree3-11"); 56 57 click(5, 1); 59 check("tree3-12"); 60 click(3, 1); 62 check("tree3-13"); 63 64 click(5, 1); 66 check("tree3-14"); 67 click(7, 1); 69 check("tree3-15"); 70 71 click(2, 1); 73 check("tree3-16"); 74 click(8, 1); 76 check("tree3-17"); 77 78 click(2, 1); 80 check("tree3-18"); 81 click(3, 0); 83 check("tree3-19"); 84 85 } 86 87 } 88 | Popular Tags |