1 package org.displaytag.jsptests; 2 3 import org.displaytag.test.DisplaytagCase; 4 5 import com.meterware.httpunit.GetMethodWebRequest; 6 import com.meterware.httpunit.WebRequest; 7 import com.meterware.httpunit.WebResponse; 8 9 10 15 public class Displ009Test extends DisplaytagCase 16 { 17 18 21 public String getJspName() 22 { 23 return "DISPL-009.jsp"; 24 } 25 26 31 public void doTest(String jspName) throws Exception 32 { 33 WebRequest request = new GetMethodWebRequest(jspName); 34 WebResponse response; 35 36 response = runner.getResponse(request); 38 39 42 response = response.getLinks()[0].click(); 44 assertNotNull("Not in page one as expected", response.getElementWithID("PAGEONE")); 45 46 response = response.getLinks()[0].click(); 48 assertNotNull("Not in page one as expected", response.getElementWithID("PAGEONE")); 49 50 response = response.getLinks()[1].click(); 52 assertNotNull("Not in page two as expected", response.getElementWithID("OTHERPAGE")); 53 54 response = response.getLinks()[0].click(); 57 assertNotNull("Not in page one as expected", response.getElementWithID("PAGEONE")); 58 } 59 60 } | Popular Tags |