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 /** 11 * Tests export with a null list. 12 * @author Fabrizio Giustina 13 * @version $Revision: 707 $ ($Author: fgiust $) 14 */ 15 public class EmptyExportTest extends DisplaytagCase 16 { 17 18 /** 19 * @see org.displaytag.test.DisplaytagCase#getJspName() 20 */ 21 public String getJspName() 22 { 23 return "emptyexport.jsp"; 24 } 25 26 /** 27 * Test that export links are not shown on generated page. 28 * @param jspName jsp name, with full path 29 * @throws Exception any axception thrown during test. 30 */ 31 public void doTest(String jspName) throws Exception 32 { 33 34 WebRequest request = new GetMethodWebRequest(jspName); 35 36 WebResponse response = runner.getResponse(request); 37 38 assertEquals("Export links should not be shown for an empty table", 0, response.getLinks().length); 39 40 } 41 }