package org.displaytag.jsptests;

import org.displaytag.test.DisplaytagCase;

import com.meterware.httpunit.GetMethodWebRequest;
import com.meterware.httpunit.WebRequest;
import com.meterware.httpunit.WebResponse;
import com.meterware.httpunit.WebTable;


/**
 * Tests with a null list.
 * @author Fabrizio Giustina
 * @version $Revision$ ($Author$)
 */
public class EmptyTableTest extends DisplaytagCase
{

    /**
     * @see org.displaytag.test.DisplaytagCase#getJspName()
     */
    public String getJspName()
    {
        return "empty.jsp";
    }

    /**
     * Verifies that the generated page doesn't contain any table (but doesn't crash!).
     * @param jspName jsp name, with full path
     * @throws Exception any axception thrown during test.
     */
    public void doTest(String jspName) throws Exception
    {
        WebRequest request = new GetMethodWebRequest(jspName);

        WebResponse response = runner.getResponse(request);

        WebTable[] tables = response.getTables();

        // only the second table should be shown
        assertEquals(1, tables.length);

        assertEquals("Empty table message: colspan should be 2", 2, tables[0].getTableCell(1, 0).getColSpan());
    }
}
@@ -942,24 +942,122 @@
 (request);%0A%0A
+        if (log.isDebugEnabled())%0A        %7B%0A            log.debug(response.getText());%0A        %7D%0A%0A
         WebT
@@ -1165,16 +1165,43 @@
 tEquals(
+%22Wrong number of tables.%22, 
 1, table
@@ -1211,17 +1211,16 @@
 ength);%0A
-%0A
         

debug info