1 package org.displaytag.jsptests; 2 3 import org.displaytag.test.DisplaytagCase; 4 5 import com.meterware.httpunit.GetMethodWebRequest; 6 import com.meterware.httpunit.TableRow; 7 import com.meterware.httpunit.WebRequest; 8 import com.meterware.httpunit.WebResponse; 9 import com.meterware.httpunit.WebTable; 10 11 12 17 public class Displ192Test extends DisplaytagCase 18 { 19 20 23 public String getJspName() 24 { 25 return "DISPL-192.jsp"; 26 } 27 28 33 public void doTest(String jspName) throws Exception 34 { 35 WebRequest request = new GetMethodWebRequest(jspName); 36 37 WebResponse response = runner.getResponse(request); 38 39 if (log.isDebugEnabled()) 40 { 41 log.debug(response.getText()); 42 } 43 44 WebTable[] tables = response.getTables(); 45 assertEquals("Wrong number of tables in result.", 1, tables.length); 46 assertEquals("Wrong number of rows in result.", 4, tables[0].getRowCount()); 47 48 if (log.isDebugEnabled()) 49 { 50 log.debug(response.getText()); 51 } 52 53 TableRow[] rows = tables[0].getRows(); 54 assertEquals("Wrong number of rows in result.", 4, rows.length); 55 56 assertEquals("", rows[0].getClassName()); 57 assertEquals("odd", rows[1].getClassName()); 58 assertEquals("even", rows[2].getClassName()); 59 assertEquals("odd highlighted", rows[3].getClassName()); 60 61 assertEquals("", rows[0].getID()); 62 assertEquals("rowid0", rows[1].getID()); 63 assertEquals("rowid1", rows[2].getID()); 64 assertEquals("rowid2", rows[3].getID()); 65 66 } 67 68 } | Popular Tags |