
package org.eclipse.birt.report.tests.viewer.regression;

import org.apache.cactus.WebRequest;
import org.eclipse.birt.report.servlet.BirtEngineServlet;
import org.eclipse.birt.report.tests.viewer.BaseViewerTestCase;

import com.meterware.httpunit.WebResponse;

/**
 * <b>Steps to reproduce:</b>
 * <ol>
 * <li>Create a report
 * <li>Add a cascading or dynamic parameter
 * <li>Save the report, and preview in HTML
 * </ol>
 * <b>Actual result:</b>
 * <p>
 * Parameter dialog didn't popup, error message shown
 * <p>
 * <b>Expected result:</b>
 * <p>
 * Popup parameter dialog
 * </p>
 * <b>Test description:</b>
 * <p>
 * Verify that parameter dialog popup properly
 * </p>
 */
public class Regression_122200 extends BaseViewerTestCase
{

	private final static String REPORT = "report/regression_122200.rptdesign";

	/**
	 * @param webRequest
	 * @throws Exception
	 */
	public void begin_regression_122200( WebRequest webRequest )
			throws Exception
	{
		webRequest.setURL( null, null, SERVLET_PATH_RUN, null, null );
		webRequest.addParameter( PARAM_REPORT, REPORT );
	}

	/**
	 * test_regression_122200
	 */
	public void test_regression_122200( )
	{
		BirtEngineServlet servlet = new BirtEngineServlet( );
		try
		{
			servlet.init( config );
			servlet.doGet( request, response );
		}
		catch ( Exception e )
		{
			e.printStackTrace( );
			fail( e.toString( ) );
		}
	}

	/**
	 * @param webResponse
	 */
	public void end_regression_122200( WebResponse webResponse )
			throws Exception
	{
		String title = "PARAMETER SELECTION PAGE";
		assertEquals( title, webResponse.getTitle( ) );
	}

}