@Override
@Test
public void doTest() throws Exception
{
ParamEncoder encoder = new ParamEncoder("table");
String mediaParameter = encoder.encodeParameterName(TableTagParameters.PARAMETER_EXPORTTYPE);
WebRequest request = new GetMethodWebRequest(getJspUrl(getJspName()));
request.setParameter(mediaParameter, Integer.toString(MediaTypeEnum.CSV.getCode()));
WebResponse response = runner.getResponse(request);
Assert.assertEquals("Expected a different content type.", "text/csv", response.getContentType());
// second column should be empty
Assert.assertEquals("Wrong content.", "ant,,camel\nant,,camel\n", response.getText());
// now export a nested table
encoder = new ParamEncoder("nested");
mediaParameter = encoder.encodeParameterName(TableTagParameters.PARAMETER_EXPORTTYPE);
request = new GetMethodWebRequest(getJspUrl(getJspName()));
request.setParameter(mediaParameter, Integer.toString(MediaTypeEnum.CSV.getCode()));
// this test needs the export filter
request.setParameter(TableTagParameters.PARAMETER_EXPORTING, "1");
response = runner.getResponse(request);