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 /** 12 * Test for DISPL-161 - "null" still displayed even when nulls="false". 13 * @author Fabrizio Giustina 14 * @version $Revision: 771 $ ($Author: fgiust $) 15 */ 16 public class Displ161Test extends DisplaytagCase 17 { 18 19 /** 20 * @see org.displaytag.test.DisplaytagCase#getJspName() 21 */ 22 public String getJspName() 23 { 24 return "DISPL-161.jsp"; 25 } 26 27 /** 28 * No exception when an invalid page is requested. 29 * @param jspName jsp name, with full path 30 * @throws Exception any axception thrown during test. 31 */ 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.", 1, tables.length); 44 45 assertEquals("Wrong content for first column", "", tables[0].getCellAsText(1, 0)); 46 assertEquals("Wrong content for second column", "", tables[0].getCellAsText(1, 1)); 47 assertEquals("Wrong content for third column", "null", tables[0].getCellAsText(1, 2)); 48 } 49 50 }