KickJava   Java API By Example, From Geeks To Geeks.

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


1 package com.tonbeller.wcf.web;
2
3 import com.meterware.httpunit.GetMethodWebRequest;
4 import com.tonbeller.tbutils.httpunit.XmlDiff.DefaultEqualsComparator;
5
6
7 public class PopUpTest extends HttpUnitTestCase {
8
9   public PopUpTest(String JavaDoc arg0) {
10     super(arg0);
11   }
12
13   public void testPage() throws Exception JavaDoc {
14     wc.sendRequest(new GetMethodWebRequest(servletUrl + "/popup.jsp"));
15
16     // "onmouseover" attribute contains a random id
17
utils.getXmlDiff().setAttrComparator(new DefaultEqualsComparator(){
18       public boolean equals(Object JavaDoc o1, Object JavaDoc o2) {
19         if (String.valueOf(o1).startsWith("cssdropdown"))
20           return true;
21         return super.equals(o1, o2);
22       }});
23
24     utils.check("popup-01", "filter.xsl", "testme");
25     utils.followXPath("//blockquote[@id='testme']/div/a", 0);
26     utils.check("popup-02", "filter.xsl", "testme");
27   }
28
29 }
30
Popular Tags