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 import com.meterware.httpunit.WebTable; 9 10 11 16 public class Displ068Test extends DisplaytagCase 17 { 18 19 22 public String getJspName() 23 { 24 return "DISPL-068.jsp"; 25 } 26 27 32 public void doTest(String jspName) throws Exception 33 { 34 WebRequest request = new GetMethodWebRequest(jspName); 35 WebResponse response = runner.getResponse(request); 36 37 if (log.isDebugEnabled()) 38 { 39 log.debug(response.getText()); 40 } 41 42 WebTable[] tables = response.getTables(); 43 assertEquals("Wrong number of tables in result.", 1, tables.length); 44 assertEquals("Wrong number of rows in result.", 3, tables[0].getRowCount()); 45 46 if (log.isDebugEnabled()) 47 { 48 log.debug(response.getText()); 49 } 50 51 assertEquals("Wrong column content.", "one", tables[0].getCellAsText(1, 0)); 52 assertEquals("Wrong column content.", "two", tables[0].getCellAsText(1, 1)); 53 assertEquals("Wrong column content.", "one", tables[0].getCellAsText(2, 0)); 54 assertEquals("Wrong column content.", "two", tables[0].getCellAsText(2, 1)); 55 } 56 57 } | Popular Tags |